Back to 2005 when I worked in a company where most of the code was developed in C++, in 2006 the managers decide to develop the new projects with C# and also migrate some C++ projects to C#, here were their arguments against C++:
- C++ is too complex.
- The C++ build system is too difficult to manage and maintain.
- C++ is stagnated for many years and it’s on its way to dying.
- It becomes very difficult to recruit a C++ developer.
And of course, many other opinions from the web discourage some managers to continue the development with 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 this time and as C++ developers we do not have many good arguments to convince them to not go away from C++, especially as Microsoft promoted the .net in favor of C++ and a big buzz was done around the .NET technology.
Now we are in 2018 and many changes were achieved for the C++ language. The question now is: If your company decide to go away from C++, what arguments do you have to convince your managers to still use C++?
Firstable pretending that all it’s Ok now and C++ resolved all its weakness is a bad approach, there are many things to improve to change the idea that “C++ become too expert friendly”.
Fortunately makes the C++ language simpler to use is the motivation 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 the fact that C++ and since 2011, many features were added to improve the language and more than that more features will come to makes it easy to use.
And to be more convincing it’s better to show some code snippets of some modern c++ libraries and projects.
- C++ is not anymore on its way to die, many programming language ranking indicators show that C++ is in progression.
- C++ still very active in the development forums: just take a look at SO where many C++ questions are added each day.
- C++ still very active for new project development as shown by this Github ranking from this nice post about the GitHub languages trends.
- The C++ community is growing: Indeed, if you look at Google+, Linkedin, facebook or twitter. you can remark that more and more users are interested in C++.
To resume, the fact that C++ is back and become more powerful than before is not a subjective opinion, but the statistics talk for themselves. Currently, there are N arguments in favor of C++ to not touch its existing code. The decision in many cases does not belong to the developers, but they can try to find the arguments depending on their specific context to convince the managers to still use the C++ as a primary programming language.