2014-11-16 18:20:10

HI All,
I was perusing the net the other day, and on a whim I checked to see if there was a language by the name of D. Turned out, there was such a thing. Has anyone used it, and if so what did you think of it? Supposedly, it has all the speed of C++ but with more concise coding, but if that is indeed true, the obvious followup question is: why is C++ so much more popular than D these days?

Best Regards,
Hayden

2014-11-16 19:38:56

D certainly looks nice, but the features it "improves" over are not things that a new programmer would be impressed by.  A lot of what D tries to do is make native coding better, but we live in an age where native coding is on the way out.  D isn't super mature, so there might be bugs; perhaps more harmful is that they break backward compatibility every so often.  Not in major ways, but it's definitely not frozen.  I considered it for libaudioverse, but it only compiles on the desktop platforms.  It's also got issues with debuggability, especially on windows.  It's possible it's improved since I last looked at it.
But as for why nothing's taking over the C++ niche?  That's actually really simple.  There are a number of languages that try to fill it, and to some extent they succeed, but only for niches inside the larger C++ niche.  For example Google and Go;: Go is aimed almost exclusively at building servers and specifically meeting the needs of Google, and the standard library reflects that.  Doing a game in it would be painful because the libraries don't exist.  I suspect that D isn't as popular as all that because it doesn't aim at a sub-niche.  C++ is kind of like an apex predator programming language; it's horrible and frightening and eats programmers, but it's evolved over a long time to be able to handle all of the problems you actually need a native compiled language for pretty well.  C++ has code and libraries for literally everything.  Really.
If one of these takes off enough and survives for 20 years, it'll start coming close to C++ in terms of the simple ability to go out and get code from someone else, consequently saving you weeks.  It'll also take about that long to get to the point where, if you ask a question about it, you can get an answer very very quickly.  It runs everywhere, started in a time when there was basically nothing that could compete with it, lasted 30 years and is still going strong, and here we are-hundreds of millions of lines of code, if not billions, freely available, just waiting for you to download and use.  And it runs on literally everything except some small embedded systems.  As in so small that you will stop and wonder if that RAM statistic is a typo--surely they're not measuring it in bytes?

My Blog
Twitter: @ajhicks1992