3 ms·
The arguments I hear most frequently are the same ones that Linus jumps on in this thread: the syntax is obtuse, the code isn't portable, and the language isn'
by timr 19y ago
The arguments I hear most frequently are the same ones that Linus jumps on in this thread: the syntax is obtuse, the code isn't portable, and the language isn't truly high-level (i.e. it doesn't have built-in garbage collection).
The first argument is (sadly) true -- C++ is ugly and complicated. A lot of that comes from the need for backwards compatibility with C (which isn't going to win any language beauty pageants, either), but a lot more of it comes as a consequence of the syntactic flexibility of the language.
The second argument is mostly bunk. A decade ago, it was difficult to find a standards-compliant C++ compiler; today, it's fairly easy. Sure, there are dark corners of the language where certain compilers get funky, but that can be said of FORTRAN 77 compilers, too. In general, unless you're forced to work with a old compiler, or an old, unmaintained package, it isn't very difficult to write cross-platform C++ code.
The third argument is just a straw man. Anyone who has read Stroustrup's book on the design of C++ knows why garbage collection and other "high-level" features weren't incorporated into the standard -- they didn't want to force users to adopt particular programming models or designs. Stroustrup has insisted that C++ be a flexible tool for many different types of programs and programmers; that attitude leads, somewhat inevitably, to complexity. But it makes me sad that so many people are bashing on C++ for not being "more like" other languages, when its biggest strength is probably its ability to mimic many features of those same languages, while still allowing for great efficiency.
- thomasptacek 19y agoYour third argument is fallacious. C++ is gradually incorporating everything you're talking about into the standard. Stroustrop has openly stated that lack of standardized threads were a mistake: you can't get much more environment-specific, model-specific than that.
- timr 19y agoStroustrup was referring to the standard library, and he wasn't advocating the inclusion of threads at all costs. C++ is still guided by the principle that you don't have to pay for what you don't use. That was the crux of my argument, and it continues to be true.
- thomasptacek 19y agoYou haven't refuted Linus. You've explained why the world works the way Linus says it does. But the impact is the same.
- Goladus 19y agoC is beautiful if you're standing on a motherboard staring up at it. If you think mostly in terms of how hardware works, C is a clean, powerful language. "The language isn't truly high-level" isn't the whole argument; which would indeed be a straw man. That's the main part that's tied to the "most C++ programmers suck" argument, though. He thinks the "pseudo high-levelness" of C++ encourages sloppy programming. Also there's another argument in there: Object-Orientation is overrated and often causes as many problems as it solves.
- timr 19y agoMost programmers suck in every language. If Linus' experience with C developers is that they are better than C++ developers, it's probably because he is familiar with the qualities of good C developers.
- Goladus 19y agoHere's the response from the thread: LT> "You can write bad code in any language. However, some languages, and especially some mental baggages that go with them are bad."