What is Visual Studio Code? Microsoft’s Extensible Code Editor

Visual Studio Code is a free, lightweight yet powerful source code editor that runs on your desktop and the web and is available for Windows, macOS, Linux, and Raspberry Pi OS. It comes with built-in support for JavaScript, TypeScript, and Node.js and has a rich ecosystem of extensions for other programming languages ​​(such as C++, C#, Java, Python, PHP, and Go), runtimes (such as .NET and Unity), environments (such as Docker and Kubernetes), and clouds (such as Amazon Web Services, Microsoft Azure, and Google Cloud Platform).

Along with the idea of ​​being lightweight and getting started quickly, Visual Studio Code has IntelliSense code completion for imported variables, methods, and modules. graphical debugging; fluff, multi-cursor editing, parameter hints and other powerful editing features; elegant code navigation and refactoring; and integrated source control, including Git support. Much of this was adapted from Visual Studio technology.

Visual Studio Code itself is built using the Electron shell, Node.js, TypeScript, and Language Server protocol, and is updated monthly. The numerous extensions are updated as often as necessary. The richness of support varies across different programming languages ​​and their extensions, ranging from simple syntax highlighting and square bracket matching to debugging and refactoring. You can add basic support for your preferred language via TextMate colorizers if no language server is available.

The code in the Visual Studio Code repository is open source under the MIT license. The Visual Studio Code product itself comes under a standard Microsoft product license, as it contains a small percentage of Microsoft-specific customizations. It’s free despite the commercial license.

visual studio code 01 IDG

Visual Studio Code running on macOS, in Run and Debug mode. The Python code in the top right was partially generated by GitHub Copilot.

Visual Studio Code Architecture

Telling you that Visual Studio Code uses the Electron shell, Node.js, TypeScript, and the Language Server protocol doesn’t do the architecture justice. For starters, what does the About box tell us?

Version: 1.66.2
Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977
Date: 2022-04-11T07:49:20.994Z
Electron: 17.2.0
Chrome: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
Operating System: Darwin x64 19.6.0

So, in addition to Electron (a framework that lets you write cross-platform desktop apps using JavaScript, HTML, and CSS) and Node.js (a JavaScript runtime based on Google Chrome’s V8 JavaScript engine) , VS Code uses Chromium (an open-source browser project that aims to create a safer, faster, and more stable way for everyone to experience the web) and V8 (Google’s high-performance open-source Javascript and WebAssembly engine , written in C++). Darwin is essentially the foundation of macOS; if you are using Windows or Linux, you will see that operating system listed.

The language server protocol defines the protocol used between an editor or IDE and a language server that provides language functionality like auto-completion, go to definition, find all references, etc. A language server is intended to provide language-specific intelligences and communicate with development tools over a protocol that enables inter-process communication.

The Debug Adapter Protocol (DAP) defines the abstract protocol used between a development tool (editor or IDE) and a debugger. The debug adapter protocol allows you to implement a generic debugger for a development tool that can communicate with different debuggers through debug adapters. Debug adapters can be reused across multiple development tools, greatly reducing the effort of supporting a new debugger across different tools.

This diagram by Franz Verdi Torrez roughly describes how the pieces of VS Code fit together.

Visual Studio Code Extensions

A quick search on Visual Studio Code Marketplace yields around 38,000 results, supporting hundreds of programming languages. You can manage extensions from the Marketplace, from the Extensions sidebar in VS Code, and from the VS Code command palette.

The best extension, for Python, had nearly 60 million installs when I checked in July 2022. In addition to Python 3.7+ coding, debugging, and refactoring support, the Python extension will automatically install Pylance (IntelliSense) and Jupyter (laptop) extensions.

The current plug-in categories are shown in the following table.

visual studio code 03 IDG

Who uses Visual Studio Code and why?

Visual Studio Code has millions of active users, and not just at Microsoft. Many VS Code users are, for example, developers at Google or Facebook. Many VS Code users are data scientists who like to have full Python or R language support when using Jupyter notebooks.

Developers appreciate the lightness of Visual Studio Code as an editor, combined with its ability to check syntax, complete code, refactor code, debug, and check in to a repository. Cloud and container developers appreciate VS Code’s remote capabilities and its explicit support for major clouds, Docker, and Kubernetes. Developers who work in teams like VS Code’s Git integration.

Visual Studio Code downloads and installation

You can download Visual Studio Code from its home page or, with more control, from its download page. You can also install from a Linux or Raspberry Pi OS command line using apt, apt-get, rpm, yumWhere snap, depending on your system. There are setup instructions for Linux, macOS, Windows, and Raspberry Pi. You may need to install additional components to support your source code manager and programming languages, e.g. Git, Node.js, TypeScript, a C++ compiler, Python 3.7 or later, Yeoman and/or a version of .NET.

Visual Studio Code vs. Visual Studio

Should you use Visual Studio Code or Visual Studio? Where Visual Studio Code is lightweight but extensible, Visual Studio is heavy but comprehensive. Many of the technologies in VS Code come from Visual Studio, and it’s pretty easy to move between them.

Visual Studio can generate new projects from templates. Visual Studio Code can’t, but you can use command line tools like Yeoman to generate project plans in the VS Code console. If you need code profiling, you’ll probably want to use Visual Studio.

Visual Studio was taking a frustratingly long time to open large projects. Apparently this problem has been fixed. It was also consuming entire hard drives. However, disk drives have gotten bigger, and now you can only install the parts of Visual Studio that you need.

If you’re looking for something even lighter and faster for editing than Visual Studio Code, consider Sublime Text. The big tradeoff here is that Sublime Text doesn’t do debugging.

Visual Studio Code for the web

You don’t need to install Visual Studio Code on your own computer. You can go to vscode.dev or github.dev for the stable release or insiders.vscode.dev for the latest daily release. You can then open files and folders from your own computer or from a remote repository in a lightweight version of Visual Studio Code. It is a web editor and cannot run code or language servers, although it does box run many VS Code extensions and customizations. For more functionality, you can use a GitHub Codespace, which box run and debug code and use language servers, if your organization uses a GitHub Team or GitHub Enterprise Cloud plan.

visual studio code 04 IDG

Visual Studio Code for the web. Gee, that sounds familiar.

visual studio code 05 IDG

When I opened a development folder from my local machine and then opened a Python file, Visual Studio Code offered to install the Python extensions.

visual studio code 06 IDG

Unfortunately, Python extensions, which require a language server, and debugging and runtime functionality for any language, are missing from Visual Studio Code for the web. “Limited functionality” is an overstatement. If you need to debug and run code or use a language server, switch to a local instance of VS Code or a GitHub Codespace.

In summary, Visual Studio Code is a fast, free programming editor that supports most if not all of the software development lifecycle. VS Code has tens of thousands of plugins and supports hundreds of programming languages. It’s one of the best code editors out there.

Copyright © 2022 IDG Communications, Inc.

Comments are closed.