3 ms·
> I think a lot of people would argue that many C++ features, like OO, are not strictly improvements. Sure, but D has those OO features, too, so that's an argu
by kllrnohj 7y ago
> I think a lot of people would argue that many C++ features, like OO, are not strictly improvements.
Sure, but D has those OO features, too, so that's an argument against both, not one.
> like that it's nice not to have to pass around array lengths as separate variables.
-betterC doesn't have dynamic arrays, though. That's one of the "unavailable features" currently.
But that's also sommething C++ solved as well - std::vector does exist, after all, as does move semantics to avoid copying it unnecessarily.
C++ is far from perfect, of course, but D's -betterC doesn't really fix any of C++'s issues and it doesn't retain C's simplicity. It's in an awkward middle ground between the two - is that really a viable place to be? For users that already know & have C++ codebases, what's the sales pitch here? For existing C users, what does -betterC do that hasn't already been done and already failed to attract the C holdouts?
- pjmlp 7y agoOne thing that D does better and that on C++ depends pretty much on the team and which compiler toolchain you use, bounds checking for strings and arrays. You can get them in C++, and VC++ does it by default on debug code, but not all compilers do by default and it isn't required by the standard unless you explicitly make use of the at() variants. On the other hand, every attempt to bring bounds checking to C has failed, lets see how far Microsoft goes with Checked C.