What makes Visual Studio so great?

VS Code: an overview

VS Code is simple to download and install. If you’ve never used VS Code before, you can easily install it, quickly open up a new tab, and immediately start coding away.

The interface

When you open up VS Code for the first time, you will see a user interface that looks like the following screenshot.

widget
  • Editor Window (Tabs/Groups): viewing and editing the code you’re working on

  • Workspace: seeing the files related to code

  • Sidebar: information and interaction with the Git repo you have open

  • Panels: “output” section

  • Status Bar: information about the open editor tab

Commands and the command palette

The easiest way to make things happen in VS Code is via commands found in the command palette. The command palette is a menu that appears at the top of the screen when you go up to the “View” menu and select “Command Palette” or you hit Ctrl-Shift-P on your keyboard.

Settings

You can customize just about every aspect of VS Code using settings. Settings control both default VS Code functionality and installed extensions. Settings are stored as JSON files and VS Code defines a lot of them out of the box. Open up the “Command Palette,” type “settings,” and choose “Preferences: Open Settings (JSON),” as shown below.

widget

Extensions

One of the most important features of VS Code is its extensions.

An extension is a small package you can load into VS Code that makes working with various resources easier.

You can manage extensions via the extension icon in the Activity Bar. Once you click on the icon, you should immediately see a list of the most popular extensions in the Extension Marketplace. The Extension Marketplace is where developers store extensions that you can download and install at will.

Snippets

In order to automate the way to create text blurbs, you need to be using snippets.

VS Code snippets are a handy feature, no matter what kind of development you’re doing.

Snippets allow you to type a few characters in a code editor tab that quickly expands to whatever you need it to.

You can find snippets by opening up the command palette with Ctrl-Shift-P, typing “snippets,” and hitting Enter.

The integrated terminal

The integrated terminal is integrated directly into VS Code. It isn’t an external console or window. It sits below your editor tabs at all times (unless you close it). By default, the terminal is a legacy command prompt (cmd.exe).

Working as a team with workspaces

In VS Code, a workspace is a collection of folders and settings that control behavior, typically for a single project.

Think of an app your team is developing that contains many folders, a Git repo, and perhaps a certain coding standard that everyone on the team needs to abide by. A single “project” is a good use case for a workspace.

To create a workspace, simply open one or more folders, go up to the “File” menu, click on “Save Workspace As,” and save the file. VS Code saves the workspace to a file with a code-workspace file extension. This file contains everything saved to the workspace.

Workspace and settings

Workspaces come into play, especially when it comes to settings.

Once you’re working within a workspace, open the command palette, type “settings,” and you’ll now see another option for “Workspace Settings,” as shown in the following screenshot.

widget

Workspaces are a great way to group together snippets, settings, and other items to share across a team to ensure a consistent experience.

Free Resources

Copyright ©2024 Educative, Inc. All rights reserved