Before I provide quotations and code samples, prove you're not an idiot by providing dictionary definition of word "objective" and how it refers to opinions - like the one you linked.
Honestly, I cbf to elaborate, you certainly don't strike me as a person who has skill to match their ego. That being said, consider the following:
- until very recently the Linux kernel had 4 or 5 implementations of linked list. Possibly incompatible. How's that for superior?
- goto fail. Need I say more?
- C is primitive. Sure, understanding what happens in each statement is easy, but you could tell the same about assembly, yet hardly anybody claims that assembly of anything larger than nop is readable. You could say that C is a sweet spot between readability and lack of magic, but that'd be an opinion (so it wouldn't be something *objectvely* better). And I'd disagree.
- type safety. C++ isn't perfect, because of C compatibility, but it's a lot better. Unless you consider that a disadvantage?
- templates (ok, C11 has generics, but it's like templates' retarded cousin). You could say that using void* instead is better and safer but that'd be a lie. Or a dumb opinion? Meh
- RAII. RAII alone should be enough to drop C in favour of C++.
- exceptions are meh, but they do beat C's approach to error handling (errno, anyone?) by a mile. That being said, Haskell/Rust and even Go are so much better here.
- qsort vs std::sort (google it)
- writing idiomatic C++ pretty much eliminates all the memory (or resources, more like) errors. Before you say that shitty C++ code is shitty - well, so is shitty C code.
- "zero-cost abstractions" are, in fact, zero cost. You should try them.
Btw, I am pretty disappointed by Linus' rant. C++ has a fair share of problems, but he has chosen to focus on those that had been long since solved or aren't problems at all. There's no problem with portability in C++ (want an example - look at Qt - except for system-specific code and some workarounds for ancient compilers, the same codebase is provided for Windows/Linux/Mac and other systems). Of course he was talking about state of the art in 1995. But that's a weak argument. The abstractions argument is even worse. If the change is so big that it warrants a complete rewrite I fail to see how it could be avoided with C. And this isn't 2003 anymore, compilers are good-ish at pointing the errors now.
From someone with his skill, I would expect more technical reasons. Like:
- C++03 requires working against the language to get the best performance sometimes (i.e. move semantics)
- no defined ABI standard, no de-facto standard (C rules here)
- no modules
- lots of code forced to exist in the headers
- compilation times (can be offset by careful splitting the code into pseudo-modules and PIMPL)
- Undefined Behaviour. Sure, C has lots of it too, but C++ just makes it explode more.
- there's definitely more, that's from the top of my head
I elaborated, didn't I? :/
This post was edited by KrzaQ2 on Jul 15 2016 02:59am