The C++ Ecosystem in 2023: Growth of C++20, Wider Adoption of Clang-based Tools, AI Gaining Developers’ Confidence
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:
- Inbal Levi, Lead Software Engineer at MPGC Services Ltd (Millennium), WG21 committee member
- Bryce Adelstein Lelbach, Principal Architect at NVIDIA
- Diego Rodriguez-Losada Gonzalez, Lead Architect at JFrog, the team behind Conan
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.
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.
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.
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.
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?
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.)
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:
Project models and build systems
CMake stays at the top (despite a slight drop since last year) while msbuild and Makefiles keep losing ground:
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.
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?
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:
- Striving For Better C++ Code, Part I: Data Flow Analysis Basics
- Striving For Better C++ Code, Part II: Function Summaries to Speed Up the Data Flow Analysis
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!