Learning D

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Jun 6 14:24:38 PDT 2013


On Thu, Jun 06, 2013 at 10:50:05PM +0200, Daemon wrote:
> Hi there. I am mesmerized by D and I would love to start using it to
> really learn programming. I've tried it a year ago but failed
> miserably and went back to C#. The problem I have is that I've been
> using C# and I feel it left me crippled. I don't understand a lot of
> the 'mechanical stuff', like how the hell am I supposed to use
> something I need to build from source, linking to libraries,
> debugging, etc. C# did a lot of this for me and so I've never
> learned.
> 
> So, after failing to use D for the first time, I decided that it
> would probably be best to start learning C++ and then, when I have
> solid understanding of things like these, transition to D. I have
> the advantage of a friend who lent me /C++ Primer, 5th Edition/ that
> also covers C++11.

If you're going to learn D, I highly recommend following a book that
explains D concepts. Don't pick up bad C++ habits and apply them to D:
that will only produce poor D code.  For starters, I recommend this
excellent online book (free!) that teaches programming basics using D:

	http://ddili.org/ders/d.en/index.html

Not all of the chapters have been translated from Turkish yet, but the
stuff that's already there should be enough to get you started.

And if at all possible, I highly recommend getting a copy of Andrei
Alexandrescu's "The D Programming Language" (TDPL). Another classic.


> My question is, do you recommend this approach? I am not only
> talking about learning the syntax - I consider that to be relatively
> easy. But I want to create meaningful programs and I've always
> bombed this in C#. I never really knew how to implement things and
> even though I tried my best to use the SOLID approach, I failed. I
> am hoping that if I learn C++, I can make use of some other books
> that discuss program design that I could learn.
[...]

I don't recommend learning C++ first. Just start with D. The way to
improve your coding skills is just to write lots and lots of code. The
more you write, the better you'll get at it.

After you've gained enough experience, if you want to learn *real*
programming, and you're willing to learn hard stuff in order to get
there, I recommend reading Donald Knuth's "The Art of Computer
Programming".  It's hard stuff, but it will make you an excellent
programmer, not just a good one. (But don't do this until you've learned
the basics first, so read the previous two books first, and get lots of
experience writing lots and lots of code.)


T

-- 
Never trust an operating system you don't have source for! -- Martin Schulze


More information about the Digitalmars-d-learn mailing list