Best extensions for programming in C or C ++ with Visual Studio Code

Although programming used to be done in any plain text editor, today things have changed a lot. Thanks to programming IDEs (a series of programs designed to help us program more efficiently, with fewer errors, and with different aids and error detection and correction systems), programmers can carry out their projects more efficiently and less likely to make mistakes and errors. And, the more specialized that IDE is in the language we are going to use, the better.

There are many programs for this purpose, but one of the best known that we can find is Visual Studio Code . This program is a plain text editor developed by Microsoft as OpenSource software and totally free for all types of users so that anyone can program in practically any language.

Best extensions for programming in C or C ++ with Visual Studio Code

What are Visual Studio Code extensions

This editor can specialize in some languages or others thanks to its extensions. These are small add-ons that we can download and install on top of the editor to provide additional functions or features that are not available as standard. For example, we can add syntax support for other languages, improve the program’s interface, add integrations with other platforms (such as GitHub ), have new code debuggers, and much more.

There are several ways to search for extensions in the editor. The first of them, the most manual (and least recommended) is to do it from the Visual Studio Code Marketplace . And the second, the most comfortable and fastest, is to do it from the program itself, from the ” Extensions ” section.

Extensiones C Visual Studio Code

Here we will be able to search for any extension published within the Microsoft Marketplace, download it and install it within the program with just one click. We can also see the extensions that we already have installed in the program and disable the one we don’t want to use, and even uninstall them so they don’t take up space.

Next, we are going to see which are the essential extensions to be able to program in the best possible way in C or C ++ using this program.

Extensions for C or C ++

If we are going to program in one of these two popular programming languages, we must know that we can find extensions of all kinds. Some of them serve to improve the syntax highlighting of functions, others allow us to enable features such as IntelliSense or a better debugger, and others, for example, allow us to integrate other services.

Visual Studio Code comes standard with several extensions for C and C ++ installed by default thanks to the C / C ++ Extension Pack. These are:

  • Better C ++ Syntax – Improves syntax highlighting for these languages.
  • C / C ++ : IntelliSense and debugger.
  • C / C ++ Themes : themes to improve the view of code in these languages.
  • CMake : enables the use of CMake in VSC.
  • CMake Tools : enables the use of tools and functions to better work with CMake.
  • Remote – WSL : allows us to open any directory with the Windows Subsystem for Linux.
  • Doxygen Documentation Generator : allows you to easily generate Doxygen documentation.
  • Remote – Containers : open folders or repositories directly within Docker.
  • Remote – SSH : open any folder on a remote machine with SSH.

And, in addition to this, we can also install many other extensions to improve the operation of the IDE and make our programming much better.

One of the first extensions that we are going to see is Code Runner . Thanks to it, we will be able to execute snippets or code files directly from the editor window itself, without having to compile or configure anything else. The best thing about this extension is that it is compatible with an infinity of programming languages, highlighting, among many others, C, C ++, Java, JavaScript, PHP, Python, Perl, Perl 6, Ruby, Go, Lua, Groovy, PowerShell, BAT / CMD, BASH / SH, F # Script, F # (NET Core), C # Script, C # (NET Core), VBScript, TypeScript, Visual Basic NET, and Swift.

Second, we are going to talk about another addition that seeks to improve one of the default functions included in this program: C ++ Intellisense . What this extension does is add a new Intellisense system for C and C ++ with the help of the GNU Global tags. Ideal for those looking to create free software.

Having trouble or builds to compile and run your code? C / C ++ Compile Run is the extension you are looking for. This plugin allows us to compile and execute any code easily, just by pressing a key on our keyboard, F6 (or F7, if we want to execute specific parameters). Of course, if we are on Linux we will have to install gcc, and if we are on Windows mingw.

There is nothing more tedious than including the libraries of the functions that we are going to use during our programming. And, to help us with this task, there is an extension called Include Autocomplete . Just by typing the command “#include” the extension will search the specified directories for all the existing libraries, and we will be able to see a series of recommendations to add them automatically.

And, continuing with the auto-complete, we can find another much more complete extension to install: Kite Autocomplete . This extension brings us a complete auto-complete system for a multitude of programming languages (Python, Java, Go, PHP, C / C # / C ++, Javascript, HTML / CSS, Typescript, React, Ruby, Scala, Kotlin, Bash, Vue and React) based on AI. That is, thanks to it we can save a great deal of time when writing commands and functions.

How are VSC extensions used?

Depending on the extension that we are going to use, we can use them in one way or another. The most normal thing, and what most of them do, is that once the extension is installed, it is already open and loaded into the program, ready to use it. Some can be used automatically, for example, the auto-completion ones, and others have to be invoked using a keyboard shortcut or by performing a specific task.

To find out how an extension works and how we can take advantage of it, what we must do is read the store’s file. We can find this where we have downloaded the extension, and in it we will see an explanation of how it works.

Finally, we remember that if one extension interferes with the operation of another (for example, having two auto-complete), we must disable one. We can do this from the extensions section of Visual Studio Code, using the “Disable” or “Uninstall” buttons. Once done, everything will work normally again.