What do you think of the D language?

Started by
92 comments, last by daerid 17 years, 6 months ago
D tries to fix the shortcomings of C++ by adding new language features. This is a little bit like trying to fix a wrecked '53 Volkswagen by adding fins and a periscope.
Advertisement
Quote:Original post by Sneftel
D tries to fix the shortcomings of C++ by adding new language features. This is a little bit like trying to fix a wrecked '53 Volkswagen by adding fins and a periscope.


A clever comparison. I myself have never found an use for D — when I can afford not to use C++, I'll use another language, such as C# or O'Caml or Prolog, and when I have to use C++, well, I just have to.
Quote:Original post by ToohrVyk
A clever comparison. I myself have never found an use for D — when I can afford not to use C++, I'll use another language, such as C# or O'Caml or Prolog, and when I have to use C++, well, I just have to.
Exactly my thoughts. Nothing really wrong with D as such.
The whole purpose of D is to make programming _easier_. You can write the same code in C++ with 100 files and 10,000 lines, or the same program in D with 50 files and 7,000 lines (assuming 3,000 lines are simply class definitions and function prototypes). You can compile large D projects without makefiles ( http://www.dsource.org/projects/build ), and large projects only take a couple of seconds to compile. You can use it as a scripting language alternative in *nix ( http://digitalmars.com/d/rdmd.html ).

It is a misconception that D is equal to C++ with more features. Rather, some features are added (template metaprogramming ( http://digitalmars.com/d/templates-revisited.html ), lazy evaluation of function arguments ( http://digitalmars.com/d/lazy-evaluation.html ), exception safe programming ( http://digitalmars.com/d/exception-safe.html ), and memory management ( http://digitalmars.com/d/memory.html ) and some are subtracted such as the C Macro language and other support of legacy C code.

Some features are refined, like the ability to have real typedef's, modules (which reduce project size by 50% compared to C++), built in arrays and strings, delegates instead of function pointers, and not having to use the rely on pointers, or when there are pointers they don't have their own special '->' syntax, rather just '.'

To show off the metaprogramming capabilities of D, look at a compile time raytracer program here http://www-users.mat.uni.torun.pl/~h3r3tic/ctrace/ .

The reason you would use D over Java and C# is because D is much faster not having to rely on a VM and gives access to assembly within the D language itself, not relying on the backing of a large corporate interest (less political issues), open to suggestions and improvements, but most importantly are the huge productivity boosts of dealing with a refined language rather than a clunky one.

The reason D does fall short is only because there are less libraries available for D than C++, which has nothing to do with the language itself but only goes to show that currently the D community is small. In order to overcome this obstacle, D gives access to the C language which does make it possible to bind D to C and C++ code. C++ code binding is a little bit harder but there are tools available to automatically do this for you, and there are also tools to automatically turn C .h files into .d files which allows you to access C functions within D.
Quote:The reason you would use D over Java and C# is because D is much faster not having to rely on a VM.


You seem to be a decade late. Both Java and C# use JIT compiling now.

Quote:Original post by Sneftel
D tries to fix the shortcomings of C++ by adding new language features. This is a little bit like trying to fix a wrecked '53 Volkswagen by adding fins and a periscope.
It's also kind of like taking what is basically portable macro assembly language and adding object orientation and generic programming to it.

Holy shit.

As for D, I'm not interested.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Quote:Original post by ToohrVyk
Quote:The reason you would use D over Java and C# is because D is much faster not having to rely on a VM.


You seem to be a decade late. Both Java and C# use JIT compiling now.


Alright, so instead of faster I'll just say that D does not require you to bundle a VM with it in order for the user to be able to run your program.

Quote:Original post by clayasaurus
Alright, so instead of faster I'll just say that D does not require you to bundle a VM with it in order for the user to be able to run your program.


This is absolutely true.

Holy crap. Never seen this thread before.
daerid@gmail.com
Quote:Original post by Sneftel
D tries to fix the shortcomings of C++ by adding new language features. This is a little bit like trying to fix a wrecked '53 Volkswagen by adding fins and a periscope.


Did you miss what D leaves out? Or how it improves / changes C++? Do you think the same of C#? If not, why not? If so, would you say C# is an attempt as futile as D?

Just about every complaint I remember from these boards about C++ is solved or at least vastly improved by D.

I genuinely don't understand what makes people so negative about D in contrast to how C# is promoted and even Java is talked about more positive than D. Especially the people that I think know what they are talking about, such as Sneftel, Promit and snk_kid. If it were not for the fact these people write intelligent posts all the time I'd think you all just pulled some opinion out of thin air. So yeah, I have some cognitive dissonance about it, but still D is a mighty fine language for me to program in (and yes I've also tried / still program in python, scheme, C#).

This topic is closed to new replies.

Advertisement