C++ developers have a variety of Integrated Developer Environment options available, each with advantages and disadvantages. The two we look at here are Eclipse, by The Eclipse Foundation, and Visual Studio by Microsoft. Both are mature IDEs that have passed the test of time and your choice of which to use much depends on what it is that you want to do. Some developers strictly choose one over the other, whereas others will keep both prepped and ready for whichever best fits the next project.
Whether you are making the transition from a standard code editor to an IDE, or perhaps considering using a new one, it is worthwhile to explore your options. This post is intended to highlight some of the relevant differences that C++ programmers will experience with these two popular choices.
Disclaimer: Microsoft is an Incredibuild technology partner and Visual Studio is one of our tightly integrated development environments. As such, we are big fans, but that doesn’t take away from our love of Eclipse. These two IDEs are among the best C++ IDEs and editors in the industry and in this post, we point to what we think the important things are to consider when deciding which best suits you.
The Eclipse IDE is a well-known open-source framework that was originally released in late 2001 and has been long favored for Java code development. Although initially tailored to Java, the IDE is highly extensible and has support for many languages including C, C++, C#, and several others. Its fan base numbers in the millions and its users are pleased with the code highlighting and refactoring options, version control system integration, and advanced debugging features.
Eclipse is being continuously developed and updated, with releases currently on a 13-week cycle. With the concept of open-source at the very heart, it has an exceptionally active community and worldwide contributors to the project.
Why Visual Studio?
As our premier choice of IDE, Visual Studio is a full-featured software development platform that supports multiple target operating systems and a variety of programming languages. It was first released in 1997, and the product was a bundling of several others included Visual C++. The inbuilt code editor offers IntelliSense and auto-completion for efficient coding, customizable code formatting options, a powerful and easy-to-use debugger, and great documentation is available for all of it. The official documentation available online is among the best in the industry.
It has support for developing console and GUI applications, as well as web applications and web services. Many developers consider Visual Studio the ultimate IDE for C++ code development. Visual Studio 2019 version 16.1 added support for using C++ with the Windows Subsystem for Linux (WSL), which lets you run a lightweight Linux environment directly on Windows. Instructions for setting this up can be found in this post.
Visual Studio has an active community, plenty of plugins, and the platform is frequently updated. Microsoft recommends that individuals use the free, Community Edition for either Windows or Mac, and there are a variety of options available at the business and enterprise levels.
Eclipse vs Visual Studio Comparison
If you are planning to transition from a code editor to a more feature-filled IDE then both of these options have plenty to offer. One of the important aspects to consider is extensibility. Extensions come by way of plug-ins or add-ons, and having relevant additions is a quick and efficient way to enhance your coding experience.
The Eclipse Marketplace offers myriad customizations and extensions to assist with coding, testing, and the software development lifecycle in general. Among these is the all-important Eclipse C/C++ Development Tooling (CDT), which is the focus of much contribution activity.
The Visual Studio Marketplace is the official repository for Visual Studio extensions. Extensions come in the form of macros, add-ons, and packages. There are thousands of add-ons available to enhance your development experience, and you can publish your own as well. Extensive documentation and an active community are available to assist with writing extensions. Some of the ones that we at Incredibuild really like can be found in this post about 2021 Visual Studio C++ extensions that will make your life a lot easier.
Multiple OS Support
Visual Studio is available on Windows and Mac operating systems, although Visual Studio for Mac does not support Microsoft C++. Rather, it is used for .NET languages and cross-platform development. In a blog post that discusses the upcoming changes in Visual Studio 2022, there is mention of significant changes coming to the Mac release, including more consistency between Windows and macOS versions, although there is no mention of support for C++.
Eclipse differs from Visual Studio notably in this regard, as there are versions available for Windows, macOS, and Linux.
Better support for Mac and Linux systems is something that Microsoft has dealt with in a related product. In support of developers that work in these environments, Microsoft has released the powerful and feature-rich Visual Studio Code editor. It is an open-source application available for Windows, macOS, and Linux, although its functionality does not compare to that of the full IDE.
It is to be noted that while Visual Studio for C++ runs only on windows, it can still compile C++ for Linux – using Cygwin or MinGW or compiling on a remote Linux machine. The “remote” machine can be a local VM / docker, so in fact, you can compile from your windows Visual Studio C++ Code for Linux based on your local co-hosted Linux.
Another option mentioned above is compileing for WSL (windows subsystem for Linux).
Installation and Configuration
Traditionally, installing Eclipse and setting it up for standalone C++ development has been a multistep process. It involved installing the basic framework, followed by the C/C++ development tools. Before you can even get started, a JVM needs to be installed. Written and video tutorials abound, some users have complained about difficulties with the initial setup.
Nowadays, the Eclipse Installer is available, which reduces the number of steps and generally simplifies the process. Setting it up for standalone C/C++ development is as simple as selecting the package that you want to install. The process is slightly more complex for developers who write code in both Java and C++ because it relies on having multiple packages installed, although it is still relatively easy.
Image source: Eclipse Installer – The Eclipse Installer has an option for C/C++ developers.
Setting up Visual Studio begins with downloading the Visual Studio Installer, which is a setup tool used to install or modify your Visual Studio environment. Once the installer is running, choosing the workloads may look daunting but despite the number of options available for things like multiplatform development and additional toolsets, the basic process is a small set of step-by-step instructions.
The Desktop & Mobile section in Visual Studio Installer.
Visual Studio Installer persists as part of the deployment, accessible at any time in the future. If for example at some point, you want to install the C++ mobile development tools for iOS and Android applications, it only takes a couple of clicks to add.
Both of these IDEs have a rich set of menus and controls, customizable through the interface as well as by using various plugins. The consensus among developers is that Eclipse is slightly less responsive, albeit faster than other Java IDEs. The speed of the Visual Studio interface improves, even more, when additional resources are available. In general, both of the IDEs rate high in terms of usability.
One unique feature that Eclipse developers appreciate is Perspective. A perspective is essentially a layout, where the visible actions and views change depending on the task at hand. There are a set of perspectives related to C++ development, which include one for coding and one for debugging. Having a subset of relevant controls is an effective way to combat menu overload and difficulty in finding a specific command when you need it. Eclipse comes with several perspectives out of the box, but can be further customized to fit your needs.
Visual Studio users enjoy a similar functionality when entering debug mode; some controls are hidden, whereas other, debug-related controls appear. Essentially, the relevant controls are brought to the forefront and made easier to access when they are needed. The degree of flexibility afforded to Eclipse users with perspectives is something that can be accomplished using a plug-in but does not exist natively.
Code Efficiency and Beautification Enhancements
Eclipse and Visual studio have highly customizable interfaces, both natively and through the use of plug-ins, but that is not the same as the coding enhancements they offer such as syntax highlighting and autocompletion.
Eclipse includes the Content Assist feature, which offers code autocompletion, class members list, and related documentation. The many other editor-related options include syntax coloring, tab specification, curly brace placement, and a multitude of other options. You can even configure it to automatically reformat your code every time you save a file, which is a helpful way to maintain a uniform coding style when working in a team.
Visual Studio has the all-powerful IntelliSense, which offers code completion, information about parameters, class member lists, and more. It provides intelligent code completions that help with programming speed and accuracy, often circumventing errors long before the compile www. In addition to native support, many plug-ins such as Visual Assist are also available to boost productivity and make coding more convenient. Syntax coloring and dozens of code beautification options are also available.
A powerful debugger is indeed one of the things that developers expect in an IDE, over a simple code editor, and both of the IDEs are fantastic in this regard. Both have features that allow you to use conditional breakpoints that don’t stop the execution indiscriminately, as well as watch the contents of variables in many ways. Each one offers the ability to edit code whilst debugging, then continuing execution without having to restart. Eclipse has a feature, for example, called a “Dynamic Printf”, which gives you the ability to call the print function without having to recompile and restart the application.
The following screenshot depicts the Eclipse C++ debug perspective in action. The execution is paused at the indicated line, and all of the relevant information is displayed in various panes.
This screenshot is taken from the CDT FAQ and shows an example of the debug perspective.
Controlling execution is arguably the most important component of a debugger and Visual Studio has a very powerful feature called “Set Next Statement”. It acts somewhat like a time machine for your debug process, where if you have inadvertently stepped over something that you wanted to inspect more closely, you can rewind execution to a specific point of your choosing. This ability is unrivaled by other debuggers.
The following screenshots show the debugger at work, with the yellow arrow on the left indicating the current line to be executed. As the tooltip hint message indicates, the arrow can be dragged to a new line to be executed. For example, the execution can be rewound to the previous line, where a different “pivotPostion” could be set.
Full-screen debug mode.
A closer look at “Set next statement”.
Again, as is the case with many features in this look at Eclipse vs Visual Studio, the general functionality is the same but some of the details vary just enough to elicit a preference of one over the other.
For a recent usage tutorial on using OpenCV with Eclipse see this “howto” in the opencv project.
For a similar tutorial, for how to use OpenCV with Visual Studio see this “howto” in the opencv project.
Comparison Table – Eclipse vs Visual Studio
|Recommended Hardware Requirements||RAM: 4 GB (better: 8 GB and even 16 GB)
Disk space: ~300MB
Processor: 1.8 Ghz Quad Core and up
|RAM: 2 GB (better: 4 GB or even 8 GB)
Disk space: at least 800 MB (typical installations requires ~20-50 GB of disk space)
Processor: 1.8 Ghz Quad Core and up
|Initial setup||Install Java first, then Eclipse, followed by C/C++ Development Tools. The Eclipse CDT Installer simplifies the process.||Step-by-step instructions are easy to follow. C/C++ support is straightforward to configure, with options available for different target platforms.|
|User interface responsiveness||Content assist and code completion features can be a bit slow, especially if running on low resources||IntelliSense and code beautification features are usually responsive and fast|
|Target Operating Systems for C++||Windows, macOS, Linux||Windows, Linux|
|Operating system (runs on)||Windows, macOS, Linux||Windows only (for C++ dev)|
|Project and workspace Management||Supports multiple projects in a single workspace, or multiple workspaces can be used to host projects individually||Managing projects is done through the Solution Explorer, where one solution can host multiple projects|
|Community||Large, active, open-source||Large, lots of contributors|
|Market Share in Top IDE Index
(across all SW languages)
|14.38% (Ranked #2, June 2021)||28.2% (Rank #1, June 2021)|
|Market Share for C++ development according to JetBrains C++ Dev Survey||2%||26%|
|Pricing||Free||Free for open-source, individual developers, and teams of five or less. Business and enterprise licenses are available.|
|Debugging||Debug Perspective is handy||Contains some powerful features including “Set Next Statement”|
|Plugins||The Eclipse Marketplace is a searchable extension repository that is very active and heavily relied upon||The Visual Studio marketplace hosts thousands of macros, plug-ins, and add-ons, and is also very active|
Summing it Up
This comparison of Eclipse vs Visual Studio is written as a brief introduction to these powerful and popular IDEs. The assumedly low market share in C++ for Eclipse might be a bit misleading, giving the notion that it is not a good choice, however, developers who use Eclipse CDT find it very rich in capabilities, and it is open-source and free to use. Still, when it comes to Eclipse vs Visual Studio, neither beats the other in every comparison, especially considering the subjective nature of choosing an IDE. As such, it will most likely come down to a single feature, or the general look and feel that attracts you to one versus the other. Given that both IDEs can be tried free of charge, the best advice is to get coding and try them live!