Why do you continue to use D?

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Jun 3 17:33:29 UTC 2020


On Wed, Jun 03, 2020 at 03:27:12PM +0000, Adam D. Ruppe via Digitalmars-d wrote:
> D is the one language that I rarely feel like I am fighting it;
> there's the least barrier between brain and computer and when the
> language does get in the middle it generally actually helps prevent
> mistakes.
> 
> Using other langs I just feel like I'm wasting time fighting it
> instead of getting work done.

+1. For me, D is the closest to the "ideal language" in my mind. It's
not perfect, for sure, and there are dark corners that I generally
avoid, but it's a lot closer than any other language I know of.

And yeah, like Adam, I find that with D, I'm generally focusing my
attention more on solving the problem domain rather than fighting the
language.  With other languages, I find that I'm constantly spending
time fighting the language instead of making progress in the problem
domain.

With C, I'm constantly spelling out low-level operations and manually
managing error codes and worrying about memory management. Maybe about
5% of the actual mental effort is spent in the problem domain, the rest
is spent explaining myself in excruciating detail to a machine that
simply doesn't understand what I'm trying to do.

With C++ the abstraction level is somewhat better but I'm constantly
fighting with obscure language semantics and the pathological syntax.
Not to mention *avoiding* the hundred obvious ways to write code, which
is almost always the wrong way, that will blow up in horrible ways.

With Java, I find myself with my hands tied behind my back and the
simplest of tasks requires declaring 5 helper classes, 3 wrapper
classes, 2 interfaces, and excessively-long identifiers just to do
something I could express in 3 lines of D.  I find myself spending more
time manipulating baroque language constructs and writing boilerplate
than actually making progress in the problem domain.

With scripting languages, performance is often subpar and the lack of
static typing a prime source of human errors which are hard to debug,
because you can never be absolutely sure what the real type of something
is, or whether you're accessing it in the wrong way.  I used to be a fan
of Perl, but its weird and inconsistent syntax (this was Perl 5, BTW,
never bothered to try Perl 6) makes it non-scalable to non-trivial
projects.  And besides, I find that D is generally expressive enough to
fill most of my scripting needs anyway, so I find myself reaching for D
instead of other scripting languages these days.  For very small scripts
I just use shell scripting because of convenience; but anything that
requires actual computation (like manipulating lists or doing
non-trivial things with strings) D is definitely the go-to solution.
Plus, with D, you can easily expand what's initially a throwaway script
into something much bigger without having to reengineer the whole thing
from scratch.


T

-- 
A programming language should be a toolbox for the programmer to draw
upon, not a minefield of dangerous explosives that you have to very
carefully avoid touching in the wrong way.


More information about the Digitalmars-d mailing list