Question

After reading this famous rant by Linus Torvalds, I wondered what actually are all the pitfalls for programmers in C++. I'm explicitly not referring to typos or bad program flow as treated in this question and its answers, but to more high-level errors which are not detected by the compiler and do not result in obvious bugs at first run, complete design errors, things which are improbable in C but are likely to be done in C++ by newcomers who don't understand the full implications of their code.

I also welcome answers pointing out a huge performance decrease where it would not usually be expected. An example of what one of my professors once told me about an LR(1) parser generator I wrote:

You have used somewhat too many instances of unneeded inheritance and virtuality. Inheritance makes a design much more complicated (and inefficient because of the RTTI (run-time type inference) subsystem), and it should therefore only be used where it makes sense, e.g. for the actions in the parse table. Because you make intensive use of templates, you practically don't need inheritance."

No correct solution

Licensed under: CC-BY-SA with attribution
scroll top