Coolest D features

Georg Wrede georg.wrede at nospam.org
Tue Dec 26 12:55:58 PST 2006


Andrei Alexandrescu (See Website For Email) wrote:
> Say you wanted to introduce a programmer friend to D. She might know one 
> of D's sibling languages (Java, C, C++, or C#), but you shouldn't rely 
> too much on that. What features of D would you describe first to hook 
> that friend in?

If "you shouldn't rely too much on that" means my arguments should be 
independent of the newcomer's background, then I give up.

Suppose you're a used-car salesman and you have this better-than-average 
car to sell. Now, find an argument that works equally well for customers 
like a redneck, a computer whiz kid, a plumber, a pimp, a family mother, 
a student, and a grandma.

It's a waste of gunpowder to try to conjure up a universal argument.

---

To somebody without a prior language, I'd say don't, because there 
aren't any good books out yet.


To a university I'd say: (I've spent 5 years teaching programming in a 
university)

This is the language you've been waiting for ever since Pascal went out 
the door. With this language you can teach both the standard C-family 
imperative programming concepts, as well as an exceptional selection of 
the more modern concepts.

The language is both clear enough to be used as a first language, and 
powerful and real-world usable enough to be used for post graduate work, 
as well as for professional programming. As such it offers an excellent 
"mother tongue" from which forays into other Algol family languages as 
well as non-Algol family ones can be made with a minimum of friction.

It can also be argued that if a student ultimately needs to be fluent in 
C++, he should take programming intro in D, intermediate in D, and only 
then jump (directly) to advanced C++. Since most of the concepts are 
common between these languages, the student saves much time and gains a 
more solid understanding of those concepts with D, where most of his 
attention doesn't go to ambiguities, exceptions, caveats, or the 
compiler drowning him or sending him of to wild goose chases in the night.


To a C/C++ programmer I'd say:

Automatic memory management in a compiled language, you don't know what 
you're missing until you actually try it out! Compile a 5 minute 
compilation in 15 seconds! What if you could skip using lint altogether? 
How about never again needing to spend hours explaining to the younger 
colleagues all about pointer dereferencing and double indirection? 
Learning curve for C/C++ users: next to nothing!!


To a C++ guru:

Check out the metaprogramming stuff, and what folks have done with it! 
Double your productivity, honest! And the extra bonus: when's the last 
time you actually enjoyed programming?


To a C# or Java guy:

Run without the VM!!!!! And get access to the metal, be in real control 
of the computer!! And you haven't seen this kind of speed since the 
barrio pushers got busted!


To a code shop boss:

Bounds checking, pre- and post-conditions, unit tests, no header files! 
And syntax is straightforward enough that you actually can write your 
own tools for analysis, manipulation, rules enforcement, and code 
generation! And finally: you won't believe the increase in overall 
productivity!



More information about the Digitalmars-d mailing list