Installation and setting up Visual Studio Code for beginners.

Sai Rohith T
7 min readSep 4, 2020

--

Visual Studio Code is a open-source code editor created by Microsoft. It’s available on all the major platforms i.e, Windows, Linux, and macOS.

It combines the simplicity of code editor with advanced features like debugging, IntelliSense auto-completion and with Microsoft Azure, one can deploy and host React, Angular, Vue, Node, Python, and many sites, store and query relational and document-based data, and scale with server-less computing, all with ease, all within VS Code.

Some of the key features of the Visual Studio Code are listed below,

  • IntelliSense: It auto-completes the code and has the syntaxes ready for many code blocks like a loop or a switch-case. It provides the auto-completion suggestions based on the variables and functions defined. It also handles syntax highlighting, which helps to distinguish the code easily by colorizing.
  • Debugging: One can debug code right from the editor, attach it to running apps and debug with breakpoints, call stacks, and have a interactive console.
  • Git Commands Built-in: Git is baked into this editor! Which means, source control is now much more easier and comfortable, Git commands can be used right from the editor! One can review the diffs, stage files and make commits and perform push, pull requests right from the editor.
  • Extensions: The environment of the editor is highly customizable and tweakable with the use of the extensions. These extensions can change the entire look and feel of the editor by adding themes, icons, colorizing your code, make proper indentations to make the code more readable, and help you out with the missing ‘}’ or ‘;’

Here are some extensions:

GitLens, Prettier, LiveShare, ESLint, SQLTools, LiveServer, BracketPairColorizer2, Butter🧈

to name a few.

Visual Studio Code can be used to write code in almost every language. It can also be used for mobile application development, Web Development, Dev-Ops, and many other tasks.

Due to the diversity it provides and the features it offers it’s a one stop destination for many developers.

These unique features make Visual Studio Code stand out from the other editors.

Let’s begin the installation now,

Step 1: Installing Visual Studio Code

Install Visual Studio Code from the site,

Visual Studio Code Website https://code.visualstudio.com/

There are two install variants available,

  • Stable Build
  • Insiders

I would recommend installing the Stable Build if you are a beginner,

The insiders’ version is under constant development, and it will receive more frequent updates, sometimes it may also have some problems.

Don’t go for the Insiders version unless you are a professional.

Click the Download Button, and the download will start,

When the download is completed successfully, run the executable file, Accept the license and policies and select the install location. I would recommend you to leave the installation path as it is and proceed.

Select the additional options as per your choice,

Additional Tasks

But make sure to check the “Add to PATH” option.

Now, it’ll install the files, and this ends the installation of the editor.

Step 2: Installation of the compiler or Software Development Kit(SDK’s)

This is the heart of the process. Go to the Documentation of Visual Studio Code,

This documentation has brief procedure to setup the development environment for different languages/purposes.(Skim through the documentation before proceeding further)

Visual Studio Code Documentation

The page must look something like this, from this point the process is slightly different for each of the languages, but most of the part is the same.

Step 2.1: Create a folder to store the compiler at any location on the hard-disk.(PS: If you have a SSD, put it on the SSD for faster compile-times)

The links to compilers/SDK’s of some commonly used languages,

Install the required compiler/SDK to the folder created in Step 2.1.

With the .exe files downloaded, run the executable files and choose to install it into the folder created in Step 2.1 for this purpose.

Try to keep everything default but select the install path to the destination folder (the folder previously created in Step 2.1).

Try to keep the path of the folder as small as possible.

The bin folder contains the required libraries and executables, which make the things work, So by adding this to the PATH, we are telling the computer to look for the instructions from that folder.

Step 3: Updating the PATH (Not required for Python)

We need to add the bin folder of the compiler to the PATH of the system.

Usually, the bin folder is located inside the file you created to install the Compiler/SDK.

Navigate to the bin folder located inside the installed compiler folder which is inside the folder created in Step 2.1

The path may look like,

The folder created in step 2.1>bin

Sometimes, it may be somewhere inside the folder created in Step 2.1. Search for the bin folder and, copy the file path from the address bar of Windows Explorer.

Top Right>Bottom Right>Top Left>Bottom Left

For newer languages like Python , during the installation, Check the “Add to PATH” option, and it’ll add it automatically.

We start by copying the path of the bin folder.

It may look like this,

C:\MinGW\mingw32\bin

This path depends completely on the location of the folder you installed the compiler.

For better performance, try to keep this address short and simple.

After copying the path from the address bar, we need to add this to the System Variables to enable the use globally.

To do that,

Go to Start, search for “Edit the System environment variables” and hit the enter key,

>Open Start

>Search “Edit the System environment variables”

>Hit Enter key

>Click Environment Variables

>Click Environment variables again

>Double click Path under User variables

>Click new from the recent pop-up window

>Paste the path of the bin folder which was previously copied

>Click Ok>Click Ok>click Ok

It must look something like this,

Environment Variables > Double click on user variables for “username”>Click “new”>Paste the previously copied path>click “ok”>click “ok”>click “ok”.

To verify if the compiler/SDK is updated and working fine, run the corresponding commands into the Windows Powershell(Administrator).

Commands to check the versions of the compiles/SDK’s installed,

For C : gcc --version

For C++ : g++ --version

For java: java --version

For python: python

Windows Poweshell

Now, everything is done, you can start using Visual Studio Code for development.

Fire up Visual Studio Code from Command Prompt by typing, the command

code

This will launch Vs Code,

Vs Code Welcome Page

Open the project folder (the folder where all codes are stored):

File>Open folder

1. Create a new file:

File>New File

To Create new file and opening terminal

2. Write the code.

3. Run the code ,we need to open the terminal,

After the terminal opens we must write the appropriate command to compile and run the code,

For C :

To compile the code,

.\a.exe

This will run the code,

gcc filename.c

For C++ :

To compile the code,

.\a.exe

This will run the code,

g++ filename.cpp

For Java:

java filename.java

This will compile and run the java code, the in-built debug code option can also be use for debugging the code.

For python:

python filename.py

This will run the python code.

Visual Studio Code is an excellent tool for developers. It can be used directly for web development. The extensions make it even more friendly and customizable to use. It has extensions like LiveServer, which helps host the site, and the output can be seen in real-time when the code is altered.

Vs Code also has extensions like Prettier, Bracket Pair Colorizer, and Auto close tag, which reduces the scope of errors and increase productivity.

Visual Studio Code can be used for Back-end, Front-End, Mobile App Development, Web Development, Dev-Ops, and many other development fields.

--

--

Sai Rohith T
Sai Rohith T

Written by Sai Rohith T

Major in Computer Science and Communication

No responses yet