3 ms·
Yes, RAII and exceptions (as well as a few other things like being able to declare variables anywhere) is the reason why I liked C++ in 2000 more than C. But b
by EGreg 10y ago
Yes, RAII and exceptions (as well as a few other things like being able to declare variables anywhere) is the reason why I liked C++ in 2000 more than C.
But beyond that, it all went downhill. There was no reason to make C++ the most bloated language ever.
The same is true of Javascript etc. Newbies will not be able to start, now, because they will think about let/var/const the same way as in C++ they have to think about all the possible casts, copy constructor vs casting semantics etc.
Tell me this for example, does the following use a cast or a copy constructor?
http://stackoverflow.com/questions/11222076/why-is-copy-constructor-called-instead-of-conversion-constructor http://stackoverflow.com/questions/11222076/why-is-copy-cons...
- eropple 10y ago"C++ has optional and complicated things that incur costs only when you use them, so let's not even have dtors" is...not a good look, I think.
- EGreg 10y agoGotta love those non virtual destructors which only clean up the base class. And the ambiguity about whether you're going to call a type conversion operator or a copy constructor when assigning A a = b. Because you know, it's all super clear.
- eropple 10y agoWho said anything about inheritance? Like, at all? That is yet another feature you pay for only when you adopt it. You can pick one of two problems: you can agree upon a subset of C++ to use or you can expect your C developers to be perfect all of the time (while having fewer, if any, ways to express correctness). Dragging out additional things that are not part of your subset of C++ doesn't help formulate an argument against this.
- EGreg 10y agoI agree about C needing memory management and exceptions. That's why I said I liked C++ when that's all there was. Classes were nice sumyntactic sugar. But the language jumped the shark starting with C++0x
- eropple 10y agoC++0x adds nothing you are obligated to use, though. No sharks have been jumped unless you choose to strap on some skis and rent a boat. (Meanwhile, with move semantics and unique_ptrs, C++14 is actually way nicer as far as memory management goes than that 2000-era C++ was.)