
Joseph Sibony
reading time:
I’m about to give a talk at CppCon 2021 next week on C++ Complexity.
The question whether C++ is a complex language is, of course, subjective, but there would not be many that would argue against that claim.
The question of what makes C++ complex for you is of course also subjective, but it is an interesting question with potential implications. We may deduce that:
C++ complexity has been a point of discussion for a while now. A great talk on that was given by Kate Gregory at Meeting C++17, titled: “It’s Complicated”. Some argue that the complexity is a feature of the language, others view it in terms of culture (the original blog link is not available anymore, but the discussion that it ignited is fascinating).
A nice snippet from the reddit discussion above:

So, as I said, I’m going to talk about C++ Complexity at CppCon 2021. In a similar talk that I gave at CoreCpp about two months ago, I asked the audience what makes C++ complex for them?
The question had a list of subjects prepared ahead of time, after consulting with C++ community members, trying to cover all potential complexities. Here is the list that was presented – respondents could check any number of items:
In addition to the above options, there was also an option for “other”, asking the respondents to elaborate.
The questionnaire also asked for the respondents’ years of C++ experience, with the options: 0-1 years, 2-4 years, 5-8 years, 9-12 years and more than 12 years.
The results are interesting.
Let’s start with the audience: years of experience in C++

Though the list of complexities presented in the questionnaire was quite exhaustive, a few people added their own, with items such as: understanding compiler errors, managing big projects and lack of standard tools (e.g., lack of a standard build tool).
One of the options in the list was that there isn’t anything complex: “Everything in C++ is a breeze for me”.
The total percentage marking this option was 9%, but naturally, this percentage is higher for veterans (still, only 15%) compared to beginners (5%), as can be seen in the graph:

Here are the results for the entire sample, consisting of 101 people:

The top five selections were:
But when analyzing it based on seniority, veterans and novices suffer from different things.
For veterans the top five were:
Top complexities – veterans:

For novices the top five were:
Top complexities – novices:

It is interesting to note that “Handling long build times” is in the top 5 for both veterans and beginners. This shows that this is an issue that bothers the C++ industry. Of course, we at Incredibuild are happy to solve this issue for you, with distributed build acceleration, already used by many companies in the industry.

It is also interesting to see that debugging memory leaks is still high in the list (35% picked that, in the entire sample!). And that’s long after smart pointers have become widely accepted in the industry. It is not clear if people do not use smart pointers, or otherwise misuse them. This should be further investigated.
Another interesting result is having Rvalue and move semantics at the top 5 for novices, but not much lower for veterans (#7). Seems that we do have some work cut out for us in teaching this subject better, making it easier to follow and understand.
Packaging and deployment is #5 for veterans, and as it seems we are still on the lookout for the silver bullet in that domain for C++, with several good solutions around.
C++ has its complexities, for both novices and experts. But the feeling you get when talking with C++ practitioners is that these complexities are just kind of a challenge, not an end-all or reason to look for other possibilities around (Rust, anyone? well not for C++ enthusiasts).
With the evolution of the language, though new complexities come in, many are being solved. Still, understanding the complexities that the community perceives is important if we want to look for solutions in terms of best practices, tools and further evolution of the language.
Table of Contents
Shorten your builds
Incredibuild empowers your teams to be productive and focus on innovating.
Incredibuild empowers your teams to be productive and focus on innovating.
| Cookie | Duration | Description |
|---|---|---|
| cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
| cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
| cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
| cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
| cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
| viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |