I think people are mostly blaming C++ instead of bad programmers.
I think people are mostly blaming C++ instead of bad programmers.
Let me ask you this: Have you ever worked on a large scale C++ project that didn't have performance issues? Or memory issues?
APIs can easily lose performance when refactored for correctness or code clarity. Large projects have large project issues!
And yes, large projects have large project issues. It is kind of telling that C++ needs an entire tome on large project issues, though... (Lakos, Large Scale C++ Software Design)
I don't understand this at all. The performance of a C function can change without any change to the function signature. Even the destructor scenario can happen invisibly in C code for any type that already has a cleanup function. No matter whether the cleanup function is defined as "int myproj_FooCleanup(struct Foo* foo) {...}" or "myproj::Foo::~Foo() {...}", you won't notice implementation changes until runtime.
Also, just adding a virtual destructor (without any functionality) adds cost. And unfortunately, you need to if your class happens to become a base class.