News

The Developer Ecosystem in 2020: How C++ is Doing

JetBrains has carried out its Developer Ecosystem survey for the fourth year running. It’s definitely now more than just a snapshot of a technological landscape – it’s a timeline that illustrates the evolution of the landscape. With a core set of questions that repeat yearly, it gives us not only a useful look at the current state of the ecosystem but also a more general and highly valuable overview of key trends in the community.
Dev Eco 2020

Each year we hone our questions to reduce uncertainties and ambiguities, and we also find new ways to validate the data. For the C and C++ parts, we now validate our survey results against the C++ Foundation’s “Lite” survey data. We do not expect our results to be exactly the same as the C++ Foundation’s (our methodologies and audiences are different). Rather, we do this to make sure that the discrepancies in results are valid. Both surveys highlight the same overall trends, which is good to see.

The survey does much more than just satisfy our curiosity – its results affect the evolution of our tooling. Let’s take a closer look at some of this year’s results, and discuss how they’ve changed over time and how they affect our decisions. We also asked Matt Godbolt, the creator of Compiler Explorer, to comment on the results.

Check out the full report, which covers other languages as well as developer lifestyles and fun facts, and includes a description of the survey methodology:

CHECK THE FULL REPORT

C++ language standards adoption

Developers are continuing to adopt the new C++ standards. The share of all developers using C++20 is already at 12%:
C++ standards

In previous years, the question was formulated slightly differently, as there was no C++20 back then and C++98 and C++03 were mistakenly separated. So the standards adoption timeline should be restarted now. In previous years it looked like this:
standards_timeline2

Obviously, we are interested not only in the standards currently used but also in developers’ plans to migrate and adopt newer versions of the C++ language. This year, we took a new approach to collecting this data that allowed respondents to provide different answers for different projects. From the results we see that slightly less than half of the respondents don’t have any plans to move away from the standards they currently use, while the rest are looking at various options:
Standards migration
Most interestingly, 53% are planning to migrate from C++17 to C++20! We all know C++20 is big, and it’s amazing to see so many developers planning to try it out this year.

Matt: I’m so glad nearly all folks have moved away from pre-C++11, and it’s great to see one in ten are experimenting with the latest standard. Half of C++ developers moving to a new standard is great, but it does also mean that the remaining half are stuck on an older standard.

In the report, you can see some additional slices for the questions. While general C++ facts are useful, it might be more accurate in many cases to project them onto a particular area of development. This can take into account the more conservative and vendor-specific Embedded Development, the heavily Windows-bound Game Development, and so on. For C++, there are definitely 3 big areas that we identified several years ago: Embedded Development, Game Development, and Financial Development (including HFT and banking systems). To take a closer look at the specific trends for these areas, click through the slices we’ve cut for most questions in the C++ section.

Project models

Now we come to the tools. There could be a bias here that would rank our tools higher, along with the third-party tools integrated into them. While the survey is widely promoted through external channels, we still get answers from many JetBrains fans and friends who are obviously used to working with our tools. Nonetheless, external validation shows that our results are reliable.

The top-3 project models list remains unchanged after all these years. CMake reached the top several years ago and continues to grow:
Project model timeline

But it’s no surprise that the leader for Game Development is Visual Studio.

As we understand the importance of supporting the variety of C++ project models (at least the top ones), we worked hard to get the missing member on board. Makefiles are now in CLion! It’s still in Early Access Preview, but it’s ready for you to try out and report any feedback.

Compilers

The 3 top compilers are obvious, but who is on top? GCC has sat at the top all these 4 years, but it still had some significant growth this year. Clang keeps growing as well.

Matt: GCC being the most commonly-used compiler isn’t too surprising to me. Compiler Explorer logs show it’s still the most used compiler, although it’s also the default so that skews results. I’d be interested to see how the compilation graph looks over time: In my personal experience, I’m starting to use clang more and more.

Let’s check the compilers timeline:
Compilers timeline

Unit testing, package management, code analysis

The project model is an essential tool. Even if you use some custom scripts, you can’t easily avoid having project models, as you still need to build your whole project. Meanwhile, things like unit testing, code analysis, or package management can be removed from the workflow. This might lead to quality degradation or issues with project maintenance, but in general, there is nothing preventing developers from abandoning any of these techniques.

Speaking of unit testing, at the beginning of 2020 we can see 34% of C++ developers don’t write unit tests and 15% do but don’t use any specific framework for this. With Google Test being top of the popular unit testing frameworks for C++, it’s great to see Catch now reaching 14%.
Unit testing 2020

The variety of unit testing frameworks is huge. And in our C++ tools we now support 4 of them out of the box: Google Test, Catch, Boost.Test, and doctest (which was just added to CLion in the recent 2020.2 EAP build).

Matt: I’m frankly terrified that the largest single group of C++ users don’t write unit tests at all! Even more so that within finance, 30% don’t write tests!

This is only the second year that we’ve run the question on package managers (we started in 2019), but we definitely see how tools like vcpkg and Conan are getting their piece of the pie:
Package manager timeline

And again, with the Windows ecosystem dominating Game Development, it’s no surprise that Nuget is on top there.

Matt: It’s unfortunate to see how fragmented the dependency manager market is, with no clear cross-platform solution.

Every year when looking at the code analysis related question, we feel our responsibility to the community. While one third doesn’t use any code analysis tools, another third uses the tools provided by their IDE. This means that if an IDE lacks integration, and there is no easy way to call the code analyzer in the editor and review the results, it won’t be used at all!
Code analyzers
Obviously, Clang-family tools are super popular (and are now well integrated into all major IDEs), with Clang-Tidy and Clang analyzer growing yearly.

Matt: It’s disappointing how few folks are using static analysis outside of an IDE. For me, it’s a great thing in an IDE, but it’s even better as part of a CI system.

That’s it! What do you think about these trends? Let us know in the comments section below! And check out the full results in the report:

CHECK THE FULL REPORT

The raw data (anonymized, of course) will be published later, so you can investigate and analyze it deeper on your own.

Your CLion team
JetBrains
The Drive to Develop

image description