4 ms·
I've genuinely enjoyed switching to D for hobby game projects. There's some new problems that I haven't quite figured out (like GC allocations ONLY occur at spe
by katastic 9y ago
I've genuinely enjoyed switching to D for hobby game projects. There's some new problems that I haven't quite figured out (like GC allocations ONLY occur at specific points, however, ANY GC could still blow up ANY object which means if you're not careful, you've added an entire dimension to problem solving over that of a C++ project when a finalizer gets called and does something it shouldn't.)
On the otherhand, ranges, native strings, an insanely straight-forward and powerful template engine, compile-time evaluation, native contract programming and unit testing, modules (read: what's a header guard?), make C++ feel like clanging rocks together to make fire compared to D. Actual direct support for multi-dimensional arrays without insane levels of nested template boilerplate code is worth the price of admission alone.
I could honestly go on for paragraphs listing just the features I use on a regular basis that don't exist in C++. C++ is basically "D, a decade behind." Because half the greatest features they're adding to C++ have already been in D for at least a decade.
C++ _finally_ added numeric separators (that Motorola C had ... in the 90's? Or earlier?) 1 million is 1_000_000, not 1000000. Surely, there's no chance of user error in the second version! (Be honest, how many times did your eyes check to see if the second number actually added to a million or had a typo?)
And I say this as someone who programmed C++ for decades until I found D. _It's by no means perfect_, but it's sure of a lot more enjoyable to program in.
- DmitryOlshansky 9y agoThis is one good description of what D feels like. Something that C++ is slowly adopting from except that it can’t get rid of the old cruft. D at the moment is a the most flexible and powerful tool to build something from scratch. If you care about performance ;) It’s not a ready as a “platform” though, you are still expected to build quite a few things that are usually taken for granted on your own.