What's a code editor?
In the last chapter, we went through an example of writing code in Notepad, a standard text editor for Windows. But, as with any text editor, you can only enter text, make indentations, and change font size.
With a code editor, you'll have more control over the formatting of your code for better readability. Besides the ability to change fonts and colors, it also provides simple code completion and indentation based on the selected programming language (i.e., C#, C++, Java).
In the following code example, we will open the Program.cs file from the last chapter into a code editor. You will notice that the editor has added line-numbers along with color-coding for the methods, properties, and values for better readability.
Building & running
Even though we're using a code editor instead of a text editor, we still have to follow the same process in compiling, testing, and running the application. Follow the same steps from the last chapter:
Launch the Command Prompt in Windows
Change the directory to the following: cd C:\Windows\Microsoft.NET\Framework\v4*
Run the following command: msbuild "C:\\HelloWorld\HelloWorld.sln" /p:Configuration=Release /p:Platform="Any CPU"
In File Explorer, locate the HelloWorld directory
Double-click on HelloWorld.exe located in \HelloWorld\bin\Release
Visual Studio Code: a smarter code editor
In 2015, Microsoft introduced their light-weight code editor, Visual Studio Code for both Windows and Macintosh environments.
The nice thing with Visual Studio Code is that it can be enhanced with extensions from the Microsoft Marketplace.
In the video below, let's go through some of the nice features of Visual Studio Code.
Let's recap!
Code editors provide more functionality than a text editor.
Code editors provide improved readability.
Code editors can be enhanced with additional features.