Last Updated:

Learn C++ in Visual Studio | Development environment in VS

Any software can be written directly in a standard notebook, only in this version it will be very inconvenient to edit the code. The syntax of the language will not be highlighted, there will not be most of the functions that would simplify life, there will be no hints about errors. If something does not work, then you will have to look for yourself, and after all, the error is not always obvious.

Also, Notepad will not be able to compile the project (convert the code in the programming language into a language that will be understandable to the processor - machine code). The notebook will not show in which places you can use this or that component, and in principle, many things will have to be done manually. Therefore, almost all programmers use development environments to create projects more quickly.

Introduction

 

Therefore, before you start learning a programming language, you should think about which IDE (Integrated Development Environment) to choose. Although, in fact, there is not much to choose. There is a small list of popular IDEs that you can install and use, and in this article we will talk about the development environment for C-like syntax languages: C++ and C#.

For these languages, the Visual Studio development environment is great. It has a huge functionality for productive work. This environment is suitable not only for C++ and C#, but also for the Python language. There is syntax highlighting, an IntelliSense hint that indicates typos in the code. You can install plugins to extend the functionality of the IDE. Also, the studio can be customized for yourself - to place the panels in the right places and the right order, as well as change the theme.

By itself, the studio has three versions, and for a start in learning programming, a free one is enough, since it contains all the basic and necessary tools for development. In addition, the free version can also be used commercially, because the mandatory purchase of a paid application is only if the company earns over $ 1 million or has 250 computers.

There are 3 versions:

  • Community (free)
  • Professional (paid)
  • EnterPrise (paid)

You can download the IDE here — https://visualstudio.microsoft.com/vs/compare/

True, such a set of tools takes up a lot of space. At the time of writing, it weighs about 15 GB. More to come.

In any case, the installation process is very simple, in the installer of the environment itself there is a choice among the components.
The Workloads tab contains the main components. In the section "Individual components" there are no less significant components, and at the start of the study they are not important. In the Language Packs section, you can set the language for the entire Visual Studio. This installer is very convenient, although it is worth saying that it was added only in the 2017 version.

 

first start Visual Studio

When you first start Visual Studio, it can take a long time to load, because of the loading and configuration of components. When the download is complete, the studio will open the main screen, where you can create a new project or open an old one.

In Visual Studio, a project is a compilation unit. After clicking on "Create a new project", the window for selecting project settings will open. You can configure the project type, for this you can use the filter, in which you can select the project language, platform, project type.

Create new project in vs

After clicking on the "Next" button, you can select the path to the project, you can change the project name and the name of the solution.

 

Configure Visual studio

Parsing the interface

At the very bottom is a list of errors. The comments in this list fall into two groups:

  • Warning
  • Errors

On the right side are two columns, Properties and Solution Explorer. Solution Explorer contains all the project files—the code files, the libraries, and the entire structure in principle.

On the left is the code editing window. At the top is the toolbar. The names of which speak for themselves.

Also in the control panel there is an item for selecting the type of compilation. The standard is "Debug". The essence of this compilation is that during its process, a .exe file is created that does not contain some components to run on other machines, and therefore only the one who has Visual Studio installed on the computer will be able to run such a program.

The second type also creates a startup file, but only one that is independent of the Visual Studio development environment.

It is also worth saying that if there are several projects in one solution, then you need to configure the compilation for such a number. To do this, click PKM on the name of the solution and select "Set Startup Projects..." from the drop-down menu. Next, a dialog box opens in which you must select which project to start compiling first.

Total

All programmers write projects in special environments, as they make the process more comfortable and enjoyable, which the notebook will not be able to deliver, because it does not even have a simple syntax highlighting. Visual Studio is a very powerful code editor that does a lot of routine things for the programmer and makes his life easier. There are many different features in this development environment. Of the minuses, we can note that the IDE weighs quite a lot. Of the pluses, we can highlight the ease of installation of the IDE itself.