Back in 2005, I worked at a company where most of the code was written in C++. In 2006, the managers decided to develop new projects in C# and also migrate some C++ projects to C#. These were their arguments against C++:
- C++ is too complex.
- The C++ build system is too difficult to manage and maintain.
- C++ has stagnated for many years and it’s on its way to dying.
- It has become very difficult to recruit C++ developers.
And of course, many other opinions on the web discourage managers from continuing development in C++.
More important than security is the fact that C and C++ are simply too hard to program, compared to any safe language. Not only is it too easy to write a catastrophic bug in C/C++, it is even easier to write more ordinary bugs. And these bugs are very often not caught by the compiler; they are discovered months or years later, in production, often after the programmer who wrote them has moved on.As a multi-paradigm system programming language, C++ is a complete beast when it comes to its feature-set and its specs, followed up with a steep learning curve and a very long path to mastery. It’s challenging to keep track of all its complex syntactical constructs that more often than not seem confusing and ambiguous.C++ does not have a proper module system that most modern languages provide. D, Java, C#, Python, Clojure, you name it. All of them got one. In combination with its primitive preprocessor, this usually results in a messy structure of header files and implementation files that rely on include guards to give basic protection against multiple inclusion.
At the time, as C++ developers, we didn’t have many strong arguments to convince them not to abandon C++, especially since Microsoft was promoting .NET over C++ and there was a lot of buzz around .NET technology.
Now it is 2018, and many changes have been made to the C++ language. The question is: if your company decides to move away from C++, what arguments can you use to convince your managers to keep using it?
First of all, pretending that everything is fine now and that C++ has overcome all of its weaknesses would be a mistake. There are still many things to improve if we want to change the perception that “C++ has become too expert-friendly.”
Fortunately, making C++ easier to use is one of the goals of the C++ committee, as Herb Sutter explained in a recent interview:
Since mid-2015 in particular, I decided to focus my work on seeing if I could find ways to make C++ programs simpler. Because C++ has a long-term future, anything we can do to make C++ programs easier to write, read, and maintain will deliver big benefits to the whole industry.
The way I went about it was by systematically looking at C++ code and seeing where all the boilerplate is – that is, find the things that C++ programmers already do all the time, but that they are forced to express indirectly with excessive ceremony or in complex and brittle ways, and see if we can find a very small number of general mechanisms that could let them express those things in a simpler and more direct and robust way. If we can find the places where we regularly have to fight the language (such as the language’s defaults) or work around the language (such as by using macros or proprietary language extensions) or just rely on English advice (Scott Meyers’ books are great, but wouldn’t it be great if we didn’t need to say 75% of what’s in them), and in those places be able to directly state what we want, that would be actively improving those things that we are doing already.
A “small” historical example is the range-based for loop: We could already write for loops that visit each element, but it took more ceremony such as writing the incrementing logic by hand, and it had more ways to go wrong such as inadvertently incrementing the index or iterator in the body of the loop and skipping elements. By having a ranged-based for in the language, we elevated that very common coding pattern into a language feature that lets us now say directly what we want to do, namely visit each element in order, and that is obviously correct by construction just by looking at the first line of the loop without looking inside the body to see if it might skip elements or something. And I think the range-based for loop, though a “small” feature, was one of the major successes of C++11 – an improvement that people now use every day. Adding it to the language made the language (slightly) bigger, but it made C++ programs simpler.
- The first argument in favor of C++ is that, since 2011, many features have been added to improve the language, and more are on the way to make it easier to use. To make the case more convincing, it’s better to show some code snippets from modern C++ libraries and projects.

- C++ is no longer on its way to dying; many programming language ranking indicators show that C++ is progressing.

- C++ is still very active on developer forums. Just take a look at Stack Overflow, where many C++ questions are posted every day.

- C++ is still widely used for new project development, as shown by the GitHub ranking in this interesting post about GitHub language trends.

- The C++ community is growing. If you look at Google+, LinkedIn, Facebook, or Twitter, you can see that more and more users are interested in C++.
To sum up, the fact that C++ is back and more powerful than before is not merely a subjective opinion — the statistics speak for themselves. Today, there are plenty of arguments in favor of keeping your existing C++ code. In many cases, the decision is not up to the developers, but they can identify the arguments that best fit their specific context and use them to convince managers to keep C++ as their primary programming language.
