Comment Re:Lets define our own string, vector, list classe (Score 1) 73
Thanks for the preaching, but I don't know what an "experienced C++ programmer" is. There are several different ways people programs C++, including different styles and different purposes.
Clean code is useless when it doesn't perform as expected, and performant code is useless when it's more difficult to write. C++ is meant to mix both things, so by definition it will never be entirely clean or performant. It's a language that strikes the right balance for this specific purpose.
In other words, the reason for the lack of a virtual destructor is performance. This way, the class will not need for a vtable and vpointer, and will be destructed inline. Containment will make it more difficult to write and debug, you would need to replicate operators such [], mehods such as size, etc.
So, I hope I could make my point of why the current choice is the right choice in that context.
Clean code is useless when it doesn't perform as expected, and performant code is useless when it's more difficult to write. C++ is meant to mix both things, so by definition it will never be entirely clean or performant. It's a language that strikes the right balance for this specific purpose.
In other words, the reason for the lack of a virtual destructor is performance. This way, the class will not need for a vtable and vpointer, and will be destructed inline. Containment will make it more difficult to write and debug, you would need to replicate operators such [], mehods such as size, etc.
So, I hope I could make my point of why the current choice is the right choice in that context.