DevEco News

The C++ Ecosystem in 2023: Growth of C++20, Wider Adoption of Clang-based Tools, AI Gaining Developers’ Confidence

Read this post in other languages:

Every year, JetBrains runs the Developer Ecosystem Survey to capture the landscape of the developer community, and this year’s results are finally in! One of the biggest trends of 2023 is AI usage gaining wider acceptance among software developers, with a whopping 77% of them using ChatGPT for various work-related tasks! In terms of programming languages, Objective-C is on its last legs, Rust set a new popularity record this year, and C++ and C are eighth and tenth, respectively, in the list of top languages. There are many more insights to be found in our report, so let’s dive in!

In 2023, we collected 34,493 responses from software developers worldwide. Among them, 2,627 indicated C++ as one of their top three primary languages. We scrutinized the raw data to extract valuable insights and share them with you. We also asked several community members to chime in with their comments, including renowned experts representing the language committee and companies that play a significant role in the evolution of C++. We are grateful to them for their thoughts on our data and findings:

C++ standard: C++20 as the base dialect

The downside trends for C++11 and C++14 continue, and C++17 demonstrates only tiny growth as people migrate to C++20 and C++23. Next year, we could realistically see the combined share of C++20 and C++23 surpassing that of C++17. Part of the driving force behind this is that C++ conferences have been tending to favor talks about C++20 and C++23.

Inbal Levi

It’s great to see such a significant portion of the Embedded (37%) and Games (39%) industry working with C++20 already. I have been advocating for this move, as this version extends compile time abilities, which is very beneficial for industries with a lot of emphasis on runtime performance. I hope to see similar adoption rates for C++23 in the upcoming years.

It’s very interesting to see here how C++98 and C++03 have a relatively fixed base of users, but starting from C++11, there is a significant adoption of newer versions (~4%). It’s also interesting how the newer versions – C++20 and C++23 – have the largest percentages of adoption. This is a good indication that there are at least 20% of developers who aim to be on the cutting edge of technology.

Bryce Adelstein Lelbach

A large jump in the adoption of C++20 makes sense, as implementations have become more mature and feature-complete. I think we’ll see a big shift from C++17 to C++20 as the “base” dialect for much of the community over the next few years.

It seems like the gamedev industry is ahead of the game in adopting newer C++ standards. This trend is likely to be amplified when the language adds reflection – one of the most-awaited language features for game developers in view of its high importance for object serialization algorithms. By the way, did you know that Unreal Engine emulates reflection via macros?

We also looked back and compared the recent language standards on their shares of adoption in the first year of release vs. one year later:

  • C++17 started off with 12% in 2017 and reached 18% in 2018.
  • C++20 started off with 12% in 2020 and reached 18% in 2021.
  • C++23 started off with 10% this year, so now all bets are on what share it will reach in 2024.

Diego Rodriguez-Losada Gonzalez

C++23 shows 10% adoption in 2023, a bit lower than C++20 adoption in 2020 (12%), probably related to how many new features C++20 brought compared with C++23.

The share of those who don’t plan to migrate to the newer standards hovers around 50%, with the highest figure (57%) coming from those who still use C++98/C++03. This phenomenon is not new and has a lot to do with the need to use old compiler versions, especially in some embedded projects.

Diego Rodriguez-Losada Gonzalez

[No, I don’t plan to move to another C++ standard = 57% (from C++98/03)] – This could be read as disappointing, but given that only 8% of respondents are still using C++98/03, it means that only around 4% of the world’s C++ code is stagnant in that old standard. This is not bad and similar stagnation is also seen in other programming languages.

Beyond C++

Fun fact: Last year, I managed to surprise Jason Turner by revealing that Python is the number one companion to C++ developers after C++ itself. In 2023, Python is still there with a clear lead over C:

In my C++ development experience, Python was also widely used for wrapping the project model, and I know many game development studios that still process their .sln files with Python.

Diego Rodriguez-Losada Gonzalez

I love Python as a tooling language, and I have seen lots of companies happily using it in their C++ projects for all kinds of automation, testing, project management, data processing, services, CI, etc., not necessarily always for product code. Python is yet another very useful tool for the C++ developer toolbelt.

As for Rust, there is an interesting question we’re now looking into with the JetBrains RustRover team. We’d love to know how many Rust projects are currently utilizing C++ and vice versa. Most surveys and GitHub scans indicate no more than 5%–10%, even though big companies like Google are known to be migrating parts of their huge code bases to Rust for security and safety reasons. What’s your take on that?

Bryce Adelstein Lelbach

More JavaScript and Rust being used in combination with C++ seems to be the trend here. Given the rising popularity of Rust, it’s surprising that there’s not a more rapid growth of Rust being used with C++. That suggests it may be harder to use Rust in existing projects (as opposed to new projects).

C++ tooling: The major players remain unchanged

C++ IDEs and editors of choice

Most C++ developers seem to be sticking with the same few IDEs and editors:

In terms of full-featured IDEs, CLion and Visual Studio occupy comparable positions on the market, with Visual Studio Code rivaling them as a smart editor. We are happy to be part of this competition to evolve and deliver the best experience to our users. (By the way, did you know Android Studio uses CLion’s C++ support? It builds a proprietary component on top of our source code.)

Diego Rodriguez-Losada Gonzalez

The market is clearly dominated by the Microsoft and JetBrains IDEs. It seems the quick growth of VS Code is finally slowing down (at least in the C++ audience) and has started to stabilize in equal quotas for the three major players – CLion, VS, and VS Code.

Managing third-party libraries

Managing third-party libraries is one of the biggest challenges in C++, even after 35 years of its existence. In the C++ Foundation Annual C++ Developer Survey “Lite”, this peeve took first place and was named a “major pain point” by 47% of the respondents. This comes from the fact that C++ libraries are difficult to define, and using them in a pre-built form is tricky. But there is hope yet! At CppCon 2023, CMake’s Bill Hoffman and Bloomberg’s Bret Brown talked about the initial standard for dependency management in C++ – metadata files to describe pre-built libraries. Their talk Libraries: A First Step Toward Standard C++ Dependency Management is already available on YouTube.

Per the Developer Ecosystem Survey 2023, we see fewer people building libraries from sources:

Inbal Levi

I think this is a great indication that the wide support of package managers across the C++ community is necessary. As I’ve mentioned, one of the ways (but not the only one) to promote such support is to promote standardization of the requirements from these tools, which is being discussed in the committee. Of course, there may always be a need for other solutions, but it will be interesting to see how the numbers will be affected if such commonly used package managers are standardized.

Project models and build systems

CMake stays at the top (despite a slight drop since last year) while msbuild and Makefiles keep losing ground:

Bryce Adelstein Lelbach

It is very interesting to see CMake drop in market share and Ninja increase in market share. This isn’t a trend I was aware of. Perhaps it’s just noise, but given CMake’s rapid growth until now, this data suggests that it’s reached peak saturation. That’s troubling – it would be better for C++ if we had a defacto standard build system (70% to 90% adoption). I don’t know how to interpret the growth in “None” as a build system, but I don’t think it has any deep meaning; no-one is not using a build system for large production projects.

As Bryce has spotted, Ninja is growing. The data from C++ Foundation Annual C++ Developer Survey “Lite” shows even larger gains:

This might be explained by the fact that the C++ Foundation survey offers respondents to “check all options that apply” more often. It also asks more questions focusing specifically on build tools, and some of the respondents who select Ninja must be using it as a build tool rather than a project model.

Inbal Levi

I find this data fascinating. It indicates that there are significant preferences in each domain, which signals to me that if we consider achieving any uniformity in tools by standardization (for example, by standardizing build systems’ APIs), we should make sure that we leave enough room for flexibility, to be able to support all the requirements of users in our community.

Safe and clean C++ code

Code analysis tools help us write safe and clean C++ code. Which ones are the most popular in the community?

It’s no wonder that Clang-based tooling is growing in popularity.

The share of those who don’t use code analysis at all stays around the same level, 30%, while the share of those using code analysis bundled into their IDE has dropped. What could be the reason?

Bryce Adelstein Lelbach

I think the decrease in IDE-provided analysis tools here is indicative of people incorporating static analysis into their CI, e.g. running clang-tidy, clang-format, or Clang Static Analyzer in GitHub Actions.

CI pipelines might be part of the reason. However, looking at code analysis integrated into CI/CD pipelines, we see only a very modest growth from 26% to 27%:

Per our survey data, half of the respondents run code analysis at the compilation stage. This is a missed opportunity, because running static code analysis in a “write code, detect error, fix error” loop has been shown to lead to significant time savings. And the tools these days can achieve some fantastic results! For example, the latest data flow analysis in CLion is capable of catching dead code, null pointer dereferences, memory leaks, dangling pointers, and array index issues. Read our blog post series to learn more:

AI is already here!

2023 was the first year we asked questions about AI in the Developer Ecosystem Survey. We were very curious to find out how many developers are already adopting AI in their work and which tasks and functions they’re delegating to it. The key facts we discovered are:

  • 84% of developers are familiar with generative AI tools in one way or another.
  • 43% of developers are planning to try AI tools in the near future. The biggest concern is, obviously, security, as reported by 20% of respondents.
  • Most often, developers are using AI to learn new things, brainstorm ideas, and summarize content.

Among their most time-consuming activities, developers name writing code (first place with 79%) and understanding code (second place with 47%). With the rapid evolution of AI, it’s no wonder it can already help developers with both of these tasks.

JetBrains AI Assistant is now generally available with a number of new and improved features to increase your productivity in JetBrains IDEs. In CLion, AI Assistant is always on standby to explain code, as well as CMake and runtime errors; suggest refactorings; generate documentation and commit messages; and answer questions in a context-aware AI chat. Project-aware AI actions are also available to provide more comprehensive results using extended context. Use AI Assistant in CLion as an add-on with a JetBrains AI Service subscription.

About the audience and the survey methodology 

If you compare the C++ findings in the JetBrains Developer Ecosystem survey with those in C++ Foundation Annual C++ Developer Survey “Lite”, you’ll likely spot similar trends in many areas, but also some significant differences. One important fact that needs to be kept in mind is that the audience of the C++ Foundation survey, on average, has much more experience in C++:

JetBrains researchers do their best every year to collect the most diverse data, including:

  • Attracting respondents with varying amounts of experience, from students to professional developers.
  • Making the survey accessible in more world regions by translating it into 10 languages.
  • Ensuring geographical diversity by collecting sufficiently large samples from 17 countries.

You can learn about our methodology in the dedicated section of the survey. In addition, we will soon publish the anonymized raw data from the survey so that anyone interested will be able to verify the report or build their own slices from it.

Finally, if you run similar surveys or would like to start collecting data from the community, you may want to listen to my talk from CppCon 2023, Surveying the Community: What Could Possibly Go Wrong?. In this talk, I dive into the aspects of survey methodology, including how to remove branding, targeting, and sampling biases, and explore how a properly asked question can change the data in our C++ reality. The recording is available on YouTube.

Do you have questions about the data we’ve discussed here or comments on the latest C++ community trends? If so, please share them in the comments! We’re always happy to hear what you think!

image description

Discover more