I stumbled across a year-or-so old blog entry on r/programming today titled “Why C++ is Not ‘”Back’”. The article generated a fair amount of controversy in the comments and I couldn’t resist the flamebait myself. In the article the author attempts to make the argument that C++11 is creating renewed buzz about C++ and attracting young developers to a a language that is too complicated and does not provide enough abstraction. He instead argues for Java and C# unless you’re interfacing directly with hardware (I see a lot more C in these kinds of situations ) or writing software with real-time requirements.
At this point I grew suspicious that this guy was writing lots of enterprise-y .Net software and a quick trip to view his resume confirmed my suspicions. Perhaps C++ disappeared from his daily routine but it never became some niche language or even waned enough in popularity that you could say it made a comeback. In every major language popularity index I have come across C++ has held a spot in the top 10 for as long as the index was published. C++ was never gone so it can’t be coming back.
No single language is going to be the perfect tool for every job. New programmers should not avoid C++ because burdens them with memory management or doesn’t provide enough abstraction. I would argue that these are reasons new programmers SHOULD be trained in C++ or, preferably, C. A new programmer should be forced to understand the hardware that their code is executing on, they should understand what happens they dereference null pointers and be forced to debug memory leaks and buffer overruns. Mr. Somnez even states,
If you can program in C++, you can program in any programming language. If you understand how stack and heap memory work, pointers and references and all the low level details that make C++ so tricky, it will help you when you are working at higher abstractions and in understanding how computers work in general.
He is right. If he believes this then I don’t understand why he would want to discourage new programmers from learning C++. Of course every program should not be written in C++ but every programmer should understand enough C++ and C to understand at least the very basics of how their higher-level abstractions are mapped into the bits, bytes and CPU cycles of hardware. Too many schools are churning out programmers who lack this basic understanding of the foundations on which those students hope to build their careers on because they curriculum is never adequately exposing the students to lower-level languages like C++ or C or (gasp!) assembly. By making the statement that programmers who know C++ can program in anything else the author makes the best argument for why every new programmer should learn the language.
You can hold up any language and say “This is not good for x, y, or z,” but with a language as prevalent, well-adopted and capable as C++ you’re going to have a difficult time arguing that it has no place in a programmers skill set now or in the future.