We’ve now completed 5 articles in the “Nobody Understands C++” series so here we are going to recap the misconceptions we have covered.
- You shouldn’t use all the language features of C++, that just makes your code too complicated! Wrong, we learned that by using some of the less used features of C++ we can make our code much more succinct.
- C++ is susceptible to memory leaks, buffer overruns and is an unsafe language! Wrong, by putting to use RAII techniques we avoid explicit memory allocation, the use of pointers and potential buffer overruns.
- C++ relies on C style macros for reusable code segments. Wrong, by using templates you create typesafe reusable components while avoiding the text-copying problems of C macros.
- C++ is an Object Oriented Programming language. Partially wrong, C++ does support OOP techniques but it also supports procedural and functional programming paradigms. In fact, the C++ standard library is largely designed around functional programming techniques.
- Using C++ templates causes code bloat! Wrong, C++ templates make possible programming techniques which would otherwise require an insurmountable amount of code. The misuse of those techniques may cause a lot of object code to be generated.