Difference between revisions of "User narratives on switching to D"

From D Wiki
Jump to: navigation, search
Line 43: Line 43:
 
goes with the rest of the 'make D work the way you want it to'  
 
goes with the rest of the 'make D work the way you want it to'  
 
feeling of the rest of the language)
 
feeling of the rest of the language)
 +
 +
D(md) compiles pretty fast, I think it used to have a bigger
 +
advantage here over C++ before Clang became popular but it's
 +
still pretty darn fast and makes for python-esque edit-run-debug
 +
editing style. I went from compiling my projects on the
 +
university servers to my home desktop(and it compiles faster.)
 +
 +
 +
I think D's best quality is probably how approachable it is for
 +
C/C++ programmers compared to i.e, Rust which has a (weird) ML
 +
influence. I wouldn't be surprised if you could get a C or C++
 +
programmer up to speed in D in an afternoon, at least enough to
 +
be efficient in it.
 +
 +
D is of course not all roses, shared still feels half implemented
 +
and left to rot(D's memory model in general.) TDPL is aging, and
 +
there's not too much other literature on D - but Ali's book is
 +
very good. The compiler situation feels odd, LDC and GDC have
 +
very few contributors despite being better than dmd at optimizing
 +
and providing a lot of extra perks - i.e, LDC lets you use all of
 +
the LLVM sanitizers like the thread, memory, etc. ones, and LDC
 +
provides in-depth optimization analysis thanks to LLVM.
 +
 +
But comparatively, this list is not so bad.
  
 
I feel like I could write a book on why I use D, so I'm going to  
 
I feel like I could write a book on why I use D, so I'm going to  
 
stop now : )
 
stop now : )

Revision as of 07:36, 26 May 2015

[We can clean up formatting later. I am not so good with wiki].

Story 1: please state your agreement to use your name if you don't mind it being included. (It would make the account more vivid if so):

Before I was mainly using C++ for my work(and dabbled in Rust, but never ended up switching to it) D's C-like syntax inspires familiarity to the point where I truly believe that D is easier to port C code to than C++ because you can write D in a "cleaned up" C for the most part, and slowly turn it into D whereas C++ is essentially a completely different style. Not too many languages can really claim this, and IMO it's a huge boon.

D provides native performance directly on comparison with C/C++ while being much easier to jump in and bash out a few quick ideas(Phobos helps a lot with this.)

Phobos offers far more than the C++ standard library as well. It's nice not to have to go hunting for libraries, C++11 helped with this a little I guess but it just feels like "it's there," whereas Andrei/Walter seem to actively be working towards "you should always be using Phobos or it should be fixed."

Also, D's metaprogramming system is actually usable. I use CTFE to do a ton of precomputations at compiletime, I even recently learned that the compiler can unroll foreach loops in switches(! that's cool - D has a lot of neat tricks that nobody really seems to discuss,) I feel like I'm always learning new tricks in D, and not in the C++ way.

The ability to use C libraries with barely any fuss(!), I ported a C's library's headers to D in about 10 minutes using htod and a bit of manual touchup. This is a `killer feature` in my opinion.

Ranges/functional programming in general, C++ really has nothing on this. I think C++17 might be getting ranges but when I reviewed the paper they seemed far uglier and an afterthought(like most of C++), I've written large parts of my programs in purely functional style and LDC optimizes it to the equivalent imperative code.

D's operator overloading is extremely well designed IMO,(it just goes with the rest of the 'make D work the way you want it to' feeling of the rest of the language)

D(md) compiles pretty fast, I think it used to have a bigger advantage here over C++ before Clang became popular but it's still pretty darn fast and makes for python-esque edit-run-debug editing style. I went from compiling my projects on the university servers to my home desktop(and it compiles faster.)


I think D's best quality is probably how approachable it is for C/C++ programmers compared to i.e, Rust which has a (weird) ML influence. I wouldn't be surprised if you could get a C or C++ programmer up to speed in D in an afternoon, at least enough to be efficient in it.

D is of course not all roses, shared still feels half implemented and left to rot(D's memory model in general.) TDPL is aging, and there's not too much other literature on D - but Ali's book is very good. The compiler situation feels odd, LDC and GDC have very few contributors despite being better than dmd at optimizing and providing a lot of extra perks - i.e, LDC lets you use all of the LLVM sanitizers like the thread, memory, etc. ones, and LDC provides in-depth optimization analysis thanks to LLVM.

But comparatively, this list is not so bad.

I feel like I could write a book on why I use D, so I'm going to stop now : )