C++ is one of the oldest mainstream programming languages in use today, and also easily one of the most controversial ones: some people love it (including myself), but if you read any online forums, you’d easily be under the impression that most people despise it.

The criticisms are, more often than not, fair: not many languages can rival C++ when it comes to sheer complexity, made worse by the fact that the language pretty much assumes that the programmer is an expert who knows exactly what they are doing, meaning that the language will by and large allow you to do whatever you want, no matter how insane, and if you got it wrong, well, you have absolutely no guard-rails to protect you: you’ll get cryptic compiler diagnostics, unhelpful runtime errors (“Segmentation fault” being perhaps the most notorious one), or just completely insane run-time behavior.

However, something that gets talked about a bit less often is that these properties of C++ are deliberate, and they have their uses: while C++ can be very difficult to work with, it is also immensely powerful that can allow a knowledgeable developer to write code in it that will outperform anything you could do in other, safer languages. Not to mention that there are things that you cannot even reasonably implement without having direct access to memory and allocations. There are reasons why operating systems, games, and high-frequency trading software all heavily use C++ even today, when languages like C# or Java are available and generally offer much superior developer productivity. (Rust is an interesting new contender in this consideration: it aims to beat C++ at its own game while providing convenience and more safety.)

C++ is also commonly criticized for its complexity and multi-paradigm approach which offers several distinct ways of writing computer programs. I came across this quote recently from the creator of C++ that explains the philosophy behind the language design, and addresses this point better than I could:

People don’t just write classes that fit a narrowly defined abstract data type or object-oriented style; they also — often for perfectly good reasons — write classes that take on aspects of both. They also write programs in which different parts use different styles to match needs and taste.

The language should support a range of reasonable design and programming styles rather than try to force people into adopting a single notion.

There is always a design choice but in most languages the language designer has made the choice for you. For C++ I did not: the choice is yours. This flexibility is naturally distasteful to people who believe that there is exactly one right way of doing things. It can also scare beginners and teachers who feel that a good language is one that you can completely understand in a week. C++ is not such a language. It was designed to provide a toolset for professionals, and complaining that there are too many features is like the “layman” looking into an upholsterer’s tool chest and exclaiming that there couldn’t possibly be a need for all those little hammers.