Last Updated on 2021-08-20 by Clay
Visual Studio Code is a very famous EDITOR dedicated to program development. Because my classmates and friends highly recommended it, I couldn't help researching this editor and trying it out for a while, and I recorded the steps of downloading and installing as well as the teaching of using it.
In addition to the overwhelming acclaim of Visual Studio Code on the Internet, one of the main reasons that made me want to start researching it was that I started to feel impatient with the IDE that was dedicated to writing programs: as long as I was expanding, the project file of the writing function is large, and my IDE will be quite lagging. As for which IDE I will not disclose.
Hearing that I have this trouble, some friends tell me Visual Studio Code is a great alternative.
The reason why I haven't been able to try Visual Studio Code (VSC) is because I have used Microsoft's Visual Studio (VS) before, and it is very repulsive to its memory usage.
If fact, they are different things.
But the facts proved me wrong. Visual Studio Code is actually quite light and fast to open. It even won the first place in the user statistics on StackOverflow in 2019.
Taking the introduction of Wiki, Visual Studio Code is a free code editor developed by Microsoft and supports various platforms. It supports test programs, Git version control, code completion... and other common functions.
There are similar with the IDE I am using.
In short, Visual Studio Code is very easy-to-use development environment. There is absolutely nothing wrong with it. This article will record the download and installation steps and use Visual Studio Code to run a most basic program.
Download and Installation
First we need to install Visual Studio Code: https://code.visualstudio.com/download
Then choose the version you need according to your OS, and install it after downloading it. For example, if I am use Ubuntu/Debian system, I should download the installation file in .deb format and use the following commands to install it.
sudo dpkg -i <file>.deb
After installation, open Visual Studio Code, and you should be able to see the development environment is opened.
The next step is how to use VS Code to execute the program.
Use Visual Studio Code to run a basic program
The following uses the Python language as an example.
First at all, we need to configure the Python environment, that is we need to install Python's Extension Functions, such as keyword highlighting, automatic code completion and other functions.
After creating it, use the shortcut key Ctrl + s to save it as test.py. The extension of .py will make the Python environment effective (May need to install pylint package).
As you can see from the figure below, there is already a Python keyword auto-complete function.
Here is the most classic print('Hello World!')
demonstration.
In this way, a simple Python program development environment configuration is completed. It is worth noting that there is a version number in the lower left corner of VS Code. Pay attention to whether it is the Python3 version, otherwise the print()
function will be wrong. (Python2 print does not contain parentheses, and there will be no official update support in the future, so it is not recommended)
References
- https://code.visualstudio.com/docs/setup/linux
- https://code.visualstudio.com/download
- https://code.visualstudio.com/docs/python/python-tutorial