On Friday, 11 July 2014 at 17:15:36 UTC, H. S. Teoh via
Digitalmars-d wrote:
- Metaprogramming. Templates in C++ scarred many for life.
Templates in
D are actually a pleasure to use.
- CTFE. Coupled with metaprogramming, this is a total killer
combination
that I've yet to see another language beat.
- Slices. Finally, a systems-level language whose string
support isn't
crippled (C), maimed (C++), or otherwise handicapped (Java).
And this
extends to arrays in general. While there *are* other
language with
nice string/array manipulation support, D is the only one I
know of
that does it without sacrificing performance.
- Ranges. It can totally revolutionize the way you approach
programming.
And, with metaprogramming/CTFE, they can still perform as
fast as
non-range-based code. Total win!
- Extended meaning of purity: IMO it's a total stroke of genius
to
define "weak purity" that allows you to implement pure
functions (in
the Haskell sense) using mutating primitives (loops and
assignments,
etc.). While the current compilers don't really do that much
with this
presently, there is a lot of potential here that may turn
this into a
killer feature.
- Built-in unittests. Sounds trivial, but I can testify to its
value in
dramatically improving the quality of my code. I've worked
with large
C/C++ codebases, and most of them don't even bother with any
kind of
unit testing -- it's up to the programmer to test everything,
and we
just take his word for it -- and simply accept the countless
stream of
bugs that come thereafter as a fact of life. Of the rare few
that
actually do have tests, the tests are usually (1) outdated,
(2)
commented out 'cos nobody cares to update them, (3) ignored
by the
coders anyway 'cos they can't be bothered to switch to another
language in another framework just to write tests that nobody
will run
while having their hands tied behind their back. D's built-in
unittest
blocks is a total game changer in this area, in spite of its
simplicity (which some people have complained about).
- Along these lines, static assert totally rawkz. It
ensures, at
*compile-time*, that assumptions in your code haven't been
violated
by a careless code change, forcing the person who made the
change
to fix it (rather than introducing a possibly subtle error
that
will only be uncovered months down the road on the
customer's
production site).
- The fastest regex library known on the planet (thanks to,
guess what?
metaprogramming and CTFE!). I'm a regex aficionado, and this
is a
total big deal in my book.
- Built-in Unicode support. Compiler-level support for Unicode
is
something C/C++ sorely lacks, and that immediately puts them
in the
"legacy" category. LibICU is a nightmare to use. D, however,
lets you
treat Unicode directly in the language. (Full Unicode
compliance isn't
quite there yet, but we're getting pretty close.) Modern
languages
like Java/C# also have built-in Unicode support, so D is at
least on
par with them. C/C++ is definitely behind in this category,
though.
These are just language-level cool stuff. At a higher level, we
also
have:
- rdmd: run your D programs like scripts, yet with native
compiled
performance. Rawkage!
- Dustmite: a totally revolutionary tool IMO, that changes
finding
heisenbugs from an impossible game of chance to something that
actually has hope of being fixed within reasonable amounts of
time.
- vibe.d: I haven't used it myself, but from what I hear, it's
extremely
awesome.
Great list, I'll add a couple more:
- GDC & LDC - D on ARM and other platforms is possible thanks to
talent donated to these efforts.
- D is universal - I don't know how to articulate this, but I'm
sick of learning so many languages for different purposes and
different platforms. I'm beginning to use D for just about
everything, and I don't have to worry so much about whether I'm
on Windows or Linux. I'm even using D to write low-level drivers
for my micrcontroller. I use it for my build scripts, automating
my builds in the same language I'm building. D, one language to
rule them all.
Mike