jschell wrote:
Unfortunately, this trade-off is still (and will be for years to come) absolutely unacceptable in many computing areas.
Presumably you mean as a absolute count rather than in comparison to all software fields.
What I mean is that there are many fields (although they are certainly a minority compared to all existing computing problems). Simply, there are sufficient areas to justify the existence of a language such as C++.
jschell wrote:
and the performance penalty (on modern compilers) equals zero.
You are claiming that data constructs in C++ have a zero cost? That is incorrect.
That's indeed what I am claiming and it is correct. I am not claiming that, for a specific, well-analyzed case, you can't build a better suited custom data structures (e.g. you could forego any resizing issues in a vector with a fixed-size buffer). I am, however, claiming that in a general case without any specific domain knowledge, C++ data structures have a zero performance overhead at runtime, compared to low-level Assembler implementations of the same problem. Of course, this is a theoretical upper bound. In practice, most compilers have difficulties attaining this level of optimization. But modern compilers come very close most of the time (so close, in fact, that the difference is not measurable on modern PCs). My point is, C++ provides a level of abstraction that is completely transparent and has no additional cost, compared to an equivalent solution without the use of abstraction.
jschell wrote:
In terms of original creation of C++ garbage collection probably wasn't considered at all. That would be the reason for not having it. Another reason would have been because C didn't have it.
First of all, I am pretty sure a GC was considered. Perhaps not in the first version of “C with classes” but later on. I am even pretty sure that I've read a statement saying this from one of the committee members but I can't find it now (I think it was even from Stroustrup himself, in TC++PL). Second, saying “because C didn't have it” is a real no-argument. C didn't have classes, yet we see them in C++. A GC could have been built to be completely unobtrusive and transparent on top of the memory management, thus providing backwards compatibility so this