Coding  Fan

Coding Fan

1626052020

Configuring Visual Studio Code for Arduino Development

Learn how to configure Visual Studio Code (VSC) for Arduino development, an alternative to using the Arduino Desktop IDE or Arduino Web IDE.

Subscribe: https://www.youtube.com/c/ThePolyglotDeveloper/featured

#visual-studio

What is GEEK

Buddha Community

Configuring Visual Studio Code for Arduino Development

Development Containers in Education with Visual Studio Code

We’ve heard from many educators that the first days or weeks of the semester can be lost to configuring the correct environment for students. Even so, students may still end up with a low-quality development experience or insufficient grading of their assignments:

“Set up for my students normally takes five class periods. There are version of Python to deal with. There’s a lot of complexity. Sadly that complexity takes a lot of time and money to sort out.” -[Community College US Professor CS 101]

“I would prefer a version of VS Code, specifically set up for a Python installation…” -[Assistant Professor, Liberal Arts College]

Development containers with Visual Studio Code can serve as a fantastic tool in education to ensure students have a consistent coding environment. They take care of setup so that students and instructors can quickly move past configuration, and instead focus on what’s truly important: learning and coding something great!

Development containers#

So, what are development containers? Containers are pieces of software that package code and all of the dependencies that code needs to run, including the runtime, tools, libraries, and settings. Containers were initially created as a way to deploy and manage apps in a consistent environment and make more efficient use of hardware. They later evolved to help in providing a consistent build environment, and more recently, development environment. That’s where the name dev container comes from.

When you create a container, its initial contents come from what’s known as an “image.” An image can be thought of as a mini-disk drive with things like the operating system and other tools pre-installed. You describe what goes into the image using a Dockerfile, and once you run the image, it becomes a container.

Dev containers provide a separate coding environment from your computer. For example, if you download a specific version of a dependency, that version will be unique to the container. In the diagram below, notice how the container includes the app and its necessary dependencies, keeping the computer (Host OS and Infrastructure) free and clean of any dependencies:

Containers diagram

As an instructor, you can create a specific image for an assignment. Each student will get the same exact same version of dependencies, such as the same version of Python or a C++ compiler, regardless of their operating system or any other files already installed on their computer.

Remote – Containers in VS Code#

The Visual Studio Code Remote - Containers extension lets you use a container as your main coding environment. In the classroom, an instructor can take an existing dev container, or create their own, and share it with the class. Each student can open the container in VS Code and automatically have the tools and runtimes they need to develop their applications. Students will also have access to VS Code’s full feature set, including IntelliSense and debugging, while coding.

The Remote – Containers extension works solely with Linux-based containers, so although students may have different operating systems on their computers, the coding environment will be consistent across all of them.

We’ve already seen instructors using Remote – Containers in their classrooms with success. You can check out Using DevContainers to Standardize Student Development Environments: An Experience Report to learn more about the experiences of three researchers who used dev containers in a course at UC San Diego.

This post will serve as a guide to instructors looking to implement development containers in the classroom to create a smoother, more consistent environment for their students.

To witness dev containers in action and how students can get started in just 5 minutes, check out our introductory student video.

Guide for Instructors#

With traditional set up approaches, students can run into a wide variety of issues while setting up their environment. Some examples include differences in their unique OS, where project files are stored, or small differences in runtimes or tools they’ve installed. Instructors need to be well versed in all these subtleties to be able to help students solve these issues.

A common issue is managing different versions of a tool. Let’s take Python as an example: there’s Python 2 and Python 3, along with different minor versions. Having multiple versions of Python, and then multiple accompanying tools such as linters, can be confusing and lead to errors.

To save tremendous time and confusion, we can use dev containers to create a standardized Python development environment across our class. Students will all get the same version of Python, avoiding the need to install a new version or uninstall any old ones, and everyone running the same container and source code will get the same exact results.

Prerequisites#

  • Install Visual Studio Code.
  • Install Docker Desktop.
  • Docker is the industry standard for building and sharing containers. We recommend Docker Desktop Stable 2.3.0.3 as it is the most recent and performant version of Docker Desktop.
  • There is newly introduced Docker Desktop support on Windows Home. It requires Windows 10, version 2004 and enabling the Windows Subsystem for Linux 2 (WSL 2) backend. Enable WSL 2 by following the WSL 2 installation guide.
  • For students who would prefer to not configure the WSL 2 backend, Docker Desktop for Windows can alternatively be used on Windows 10 Pro, Enterprise, or Education (Build 16299 or later), and Hyper-V and Containers Windows features must be enabled.

Let’s start off by launching VS Code, which we can do by typing code in the command prompt or terminal (or just by selecting VS Code on your computer):

Launch VS Code from command prompt

Once VS Code launches, ensure you’ve installed the Remote - Containers extension:

Remote containers extension

When we install any of the Remote extensions, the green Remote indicator is added to the bottom left of the Status bar:

Remote indicator in VS Code

You can click on it to open the Command Palette and verify the Remote-Containers commands are listed:

List of remote commands in Command Palette

Accessing a container for your class#

Let’s walk through an example dev container to help students get a consistent coding environment. In our classroom, we could create a single GitHub repository to store exercises that share the same tech stack. For instance, all the Python assignments can use the same container and be stored in the same repo.

We have an example vscode-course-sample GitHub repo with a Python dev container and two Python intro assignments. Let’s open it in VS Code.

You can select the Remote indicator in the bottom left, or use the Command Palette, to bring up the Remote-Containers commands.

Let’s call Open Repository in Container…

Open Repository in Container command

We need to enter the URL to the GitHub repo where our container is stored, which in our case is microsoft/vscode-course-sample:

Paste GitHub URL in Command Palette

You can Create a unique volume. A volume is where files will be stored in our container:

Volume options in Command Palette

Now that we’ve chosen our container repo, VS Code reloads to build the image and start the container:

Close-up on starting container notification

Once the container is built and running, our files are loaded and we can start coding within our Python environment!

Click on sort.py in the Explorer to open it, and press F5 (or the green Run icon in the top right) to run it:

Run sort.py program

Our Python code ran successfully without ever having to set up Python on our local computer.

We also have access to all the benefits of VS Code, such as setting breakpoints to pause our program and help us debug. Let’s set a breakpoint when we sort our list of words.

Setting a breakpoint

We can run our program with F5. Notice that the program stops once it hits the breakpoint:

Program stops at breakpoint

Creating a container for your class#

Now that we’ve seen a fantastic example of a container, let’s set up our first container ourselves using the Remote – Containers extension. Let’s start off in a “Hello World” Python application:

Hello world Python app

#visual studio code #visual studio #code #developer

Brain  Crist

Brain Crist

1597028400

Notes from Visual Studio Live! No Typical Developer

As the newly incumbent editor in chief of this online magazine, I eagerly anticipated attending the recent Visual Studio Live! conference in Orlando.

I looked forward to the opportunity to mingle with developers, talk about their concerns, their motivations, their challenges, their likes and dislikes of working within the Microsoft developer environment.

Basically, I wanted to talk to the folks on the front lines to help me align our coverage with what they want and need.

And that’s exactly what I did, engaging with attendees at every opportunity: over coffee and danish during breaks between sessions, over meals, during social/networking events and so on.

The main – and also enlightening and somewhat surprising – takeaway was this: There’s no typical developer who comes to these conferences, this one being part of a larger Live! 360 event.

Following are some notes on this and other insights I gleaned from the nearly one-week conference.

No Typical Developer

For some reason, I envisioned a typical developer profile of a roughly 30-something male working at a midsize/large enterprise with a sizeable developer contingent and supporting staff.

I found those, but I also talked to women, senior devs – much experienced folks with decades of experience – and even some who served as almost one-person dev shops, responsible for just about everything in the workflow, even including handling “help desk” calls.

Budget Constraints

In the mainstream media, I’m continually told the economy is booming, that America is being made great again and companies are thriving in the new order, spending their newfound largesse and increasing investments.

What I found is quite different. Attendee after attendee mentioned tight budget constraints and scarce resources and support. Everybody seems to be struggling to make do with what they have, and they attended Visual Studio Live! to learn about tools and techniques that can help them get their jobs done easier and cheaper.

Not that Cutting Edge

I continually write about the new, the previews, the betas, the next greatest, cutting-edge wonder tool coming down the pike. Many of our commissioned hands-on tutorials deal with the same.

What I found, however, is many developers more concerned with the here-and-now caretaking of existing and legacy technologies. One developer had to maintain four different versions of Visual Studio because of the hodgepodge of disparate systems and components that they separately had to tie into. (I admit that sounds odd to me. It seems there should be some way to use just one version for all the functionality needed, but I didn’t get an opportunity to delve into the details for why this approach was needed, unfortunately.)

At a panel discussion presentation, few in the audience were familiar with Progressive Web Apps, an initiative I’ve written about multiple times – something I thought was the wave of the future in the mobile space, familiar to just about everyone. That wasn’t the case for this and several other newer or cutting-edge technologies. Some coders were interested in this new-fangled Xamarin thing, for example (I thought it was a popular, well-known adjunct to the Visual Studio experience).

This tells me to review our coverage strategies to determine the correct mix of content. To go beyond examining the latest previews and betas and include more about the here-and-now challenges faced by devs on a daily basis.

To be fair, several of our commissioned hands-on tutorial experts do touch on the established tools and techniques along with the latest iPhone X dev tips and such. But perhaps we need to do more entrenched, legacy stuff. You tell me in the comments section of this article or via e-mail (address at the end).

Foresighted Companies

Related to the aforementioned budget constraints, I found it interesting that even small companies were sending their developers to Visual Studio Live! Even though times are seemingly still tough for many, firms of all sizes are sending developers to learn how to do their jobs better.

More than one attendee said their bosses (actually some of them were bosses) see it as an investment for the future. The initial cost, they believe, will be more than offset by productivity gains and new initiatives or techniques that will directly affect the bottom line.

I worked for a successful media conglomerate during the lean mid-2000s that followed the same philosophy, sending me and other staffers to educational and professional events while most others were cutting back on travel and almost all other expenses. They knew business ran in cycles, and during the next upturn the company would be better positioned for growth and success than competitors chasing the quarterly bottom line. The owner of that company wasn’t a multi-billionaire for nothing, I’m guessing.

Calling Them As I See Them, and Looking for Help

Believe, me, I’m aware that the above might be perceived by some as an advertisement for the conference. But I’m an old-school, seasoned, professional journalist who has had ethics and objectivity drilled into me starting with high school journalism classes through a college journalism degree through decades of experience at several organizations. I call them as I see them in both news articles and opinion pieces like this blog post.

So that’s what I saw and learned. And based on that, I want to do better in serving our readers. Please share your thoughts on the site’s contents – what you like, what you don’t like, what you’d like to see more of. Please comment below or drop me a line.

#visual studio #visual studio code #code #develop

COMO USAR e trabalhar com Code Review no Visual Studio Code

Não é todo programador que gosta de compartilhar o seu trabalho ou até mesmo receber feedbacks de como o seu código foi escrito, mas o Code Review é cada vez mais comum em empresas do mundo todo.

Conheça uma extensão para Visual Studio Code e comece a trabalhar com Code Review em seu próximo projeto. Essa é a sua chance de saber COMO USAR e trabalhar com Code Review no Visual Studio Code.

#visual studio code #code review #visual studio #code

Sadie  Cassin

Sadie Cassin

1598109060

How to Develop an ASP.NET Core Application Using Visual Studio Code

Visual Studio Code (VS Code) is a free, cross-platform, and lightweight source-code editor developed by Microsoft for Windows, Linux, and Mac operating systems. It is a source-code editor while Visual Studio is an IDE (integrated development environment). VS Code supports development operations such as debugging, task running, and version control, like Visual Studio.

In this blog, we will learn about developing, debugging, testing, and deploying ASP.NET Core applications using Visual Studio Code.

Prerequisites

The following packages should be installed in your machine:

Install essential plugins

  1. Install the C## extensions, which are required for development of ASP.NET Core applications. To open the list of extensions, please select the extensions icon on the left side of menu or use the Ctrl + Shift + X shortcut key. Refer to the following screenshot.
  2. Install C## Extensions
  3. Then, install the NuGet Gallery extension to add and update NuGet packages in the VS Code.
  4. Install the NuGet Gallery Extension

#asp.net core #visual studio code #web #productivity #visual studio #vs code #web development

Brain  Crist

Brain Crist

1596975120

Writing Visual Studio Extensions with Mads - Episode 1: Item Templates

Join Mads Kristensen from the Visual Studio team each week as he builds extensions for Visual Studio live!

#visual studio code #visual studio #code #microsoft #visual studio extensions