3 ms·
> It's used to write software where that complexity is a minor cost in return for the performance it provides. Other languages (C, D, Ada, Go) provide similar
by brianpgordon 13y ago
> It's used to write software where that complexity is a minor cost in return for the performance it provides.
Other languages (C, D, Ada, Go) provide similar native performance with far less complexity.
> I don't know of a single keyword that is incomprehensible. Only a few keywords are overloaded but they are overloaded in contexts that make it very very clear what they're being used for.
static, virtual, and class are all overloaded in weird ways. But punctuation is the worst: in particular commas, colons, ampersands, and asterisks are overused to absurdity. I'd almost prefer APL-like extra symbols to disambiguate some of the insane template one-liners that I've seen.
> It makes very strong guarantees about static initialization.
Are you saying that the static initialization order fiasco doesn't exist? C# and Java do not suffer from this problem.
> Exception safety is easier to reason about in C++ than any other language thanks to RAII.
I don't even know what to say to this one. Exceptions are notoriously wonky in C++. The language makes you resort to idioms like RAII and copy-swap to use them at all, instead of providing language-level support to solve those problems.
> They make sense because no one wants to rewrite the billions of lines of code that their project might depend on that uses those features. Instead, it makes a lot more sense to just avoid using deprecated or backward compatible features rather than remove them from the language and break a crap load of invaluable software in the process.
And as a consequence the language suffers. Historical reasons are not a valid defense of the present design of the language.
I am reminded of this esr quote:
"While we do not intend to insult the designers of C++, we will not make excuses for them either. They repeatedly made design choices that were well-intentioned, understandable in context, and wrong."