C++ First Impression

I just finished this 10-hour introductory video on C++ and here I want to write down what I think about the language.

Isshiki🐈
2 min readSep 26, 2020

Apparently, C++ is powerful but if you have some experience with C, you can immediately find traces of C in many of the concepts introduced by C++. For example, you can actually implement references using C pointers and classes and objects are basically structures with member functions (for C it would be directly calling similar functions from standard libraries). That said, C++ has of course introduced many useful ideas that do not exist in C, such as namespaces that let you have fine-grained control over visibility. Moreover, classes provide so much more functionality than simpler data types. Strings are now no longer just constant char arrays and you can so many useful data structures and methods right at your fingertips.

However, with all its abstractions, C++ hides so much detail from its users and as a beginner maybe you may have to count on all kinds of methods if you use only the modern part of the language (as advised by so many people, including Bjarne Stroustrup), since you are not manipulating bytes and bits, and it is not always easy since as with all modern languages there are just so many of them. But it’s not a problem, after all, to abstract data and routines and I think the really tricky part for a beginner is that the APIs of C++ can be quite confusing/leaky sometimes. For example, you can concatenate strings like [std::string] + "!" but not "string" + "!". So even though overloading and templating provide almost unlimited possibilities, it’s difficult to know how far you can go with any operator or function. Even then, you have friend functions and static member functions, so you can’t do everything with the dot syntax after all.

Such inconsistency adds further confusion to the already ill-designed C language (with all its legacy), and therefore if you need these powerful additions C++ introduces (like when you are writing algorithms) and have made up your mind not to dig further, I would recommend C++ since it can be almost as simple as Python in this respect, only much more powerful, but I would recommend C otherwise as your first language, especially if you really want to understand the language. One thing is for sure though, the more you know about C, the more familiar you will find C++.

--

--