Why I chose D over Ada and Eiffel
Ramon
spam at thanks.no
Mon Aug 19 13:18:04 PDT 2013
Frontup warning: Some of what I'll write is opinionated, not so
much in the sense of being pro or anti (whatever) but rather
based on experience and needs.
25+ years ago I started with C. I loved it. But then I had a
hacker attitude, considering "raw and tough" the only choice for
a real man *g.
It took me more than 10 years to recognize (or allow myself to
realize) that something was quite unsatisfying about C and that,
as much as I understood the necessity of OO and strongly desired
io employ it, C++ was not a solution but rather pretty much all
disadvantages of C repeated and then a major nightmare added or,
excuse my french, a major pain in the a**.
Even worse, software development had grown from an obsessive
hobby (I was an electronics engineer floating more and more
toward software) to a profession and suddenly ugly real world
factors like efficiency and productivity entered the equation.
While tools like CodeBuilder (a C++ "Delphi") seemed to promise a
better life they didn't deliver that much; not because they were
bad tool but because of C++.
- big jump -
By coincidence (or fate?) I found myself confronted with a
project demanding extreme reliability and reusability
requirements. As much as I tried, C++ just couldn't cut it. One
major reason might be interesting (or well known) to some of you:
You basically can't rely in third party C++ code. Not meaning to
talk bad about anyone but it's my bloody experience. Maybe it's
because C++ makes it so hard to actually develop and engineer
software (rather than hacking), maybe because C++ attracts guys
like my earlier self (the cool C/C++ hacker), whatever the reason
may be, that's what I experienced.
One obious (or seemingly obvious) solution was Ada. Well, no, it
wasn't. Maybe, even probably, if I had to develop low level stuff
for embedded stuff but not for a large application. And, that was
a killer for me, Ada does not really support easily resizable
arrays. To make things worse, while there nowadays is Gnat, a
nice modern IDE, there is a major lack of libraries.
Falling over the famous Ariane 5 article I looked at Eiffel. I
have to confess that I almost feel in love. Eiffel felt just
right and Prof. Meyers books convinced me again and again -
Yesss, that's the way I'd like to work and develop software.
Unfortunately, though, Prof Meyer and ISE (the Eiffel company)
made some errors, too, and in a major way.
For a starter that whole Eiffel world is pretty much a large
beautiful castle ... inmidst a desert. Theoretically there are
different compilers, factually, however, ISE's Eiffelstudio is
the only one; the others are either brutally outdated or
non-conforming or weird niche thingies or eternally in alpha, or
a mixture of those. And Eiffelstudio costs north of 5.000 us$.
Sure there is a GPL version but that is available only for GPL'ed
programs.
Next issue: Eiffels documentation is plain lousy. Yes, there are
some 5 or so books but those are either purely theoretical or
very outdated or both. Yes there is lots of documentation online
but most of it basically is luring sales driven "Look how easy it
is with Eiffel" stuff. And there is a doxygen like API doc which
is pretty worthless for learning how to practically use the
language.
Furthermore, while Eiffel comes with a lot on board there still
is much missing; just as an example there are no SSL sockets
which nowadays is a killer.
--- jump ---
So, I desperately looked for something that would offer at least
some major goodies lik DBC and would otherwise at least not stand
in the way of proper software engineering.
Well, that single feature, Design By Contract, led me toward D.
- practically useable modern Arrays? Check.
And ranges, too. And very smartly thought up and designed.
Great.
- Strings? Check
Plus UTF, too. Even UTF-8, 16 (a very practical compromise in
my minds eye because with 16 bits one can deal with *every*
language while still not wasting memory).
- DBC? Check
And once more the creators of D don't simply address one issue
but do it elegantly and, even better, sonsistently by throwing in
a nice use cases solution, too. Great!
- some kind of reasonable support for modern concurrency? Check
And again, not something thrown in that the creators of D
religously consider right (like in Eiffel where Meyer basically
force feeds his personal religious belief, although the
"seperate" solution is elegant). Great!
- Some of the major GUI(s)? Check.
Well, I couldn't care less about Java (Is t possible to repeat
all C problems creating yet another "C++" and invent a whole new
slew of burdensome and weird sh*t? Sure, look at java!) but there
seems to be a GTK binding.
- "defer mechanism"? Check.
I'm pondering about some smart defer mechanism since years. Et
voilà, D offers the "scope" mechanism. Brilliant, just f*cking
brilliant and well made, too!
- Genericity? Check
Genericity is a must, it's one of those things I'm just not
willing to even discuss making compromises. Frankly, I like
Eiffel's solution better but hey, D's solution is getting pretty
close to what I consider excellent.
An added major plus is D's bluntly straight interface to C. And a
vital one, too, because let's face it, not being one of the major
players in languages basically means to either not have a whole
lot of major and important libraries or else to (usually
painfully) bind them. D offers an excellent solution and gives me
the peace of mind to not paranoically care about *every*
important library coming with it.
Criticism:
OK, I'm biased and spoiled by Eiffel but not having multiple
inheritance is a major minus with me. D seems to compensate quite
nicely by supporting interfaces. But: I'd like more documentation
on that. "Go and read at wikipedia" just doesn't cut it. Please,
kindly, work on some extensive documentation on that.
(Probably there are some more not so great points but coming from
a strong C background, D looks 95% "natural"; sure there are
major differences but the creators of D have very nicely managed
to offer an extremely comfortable approach for anyone with solid
C experience. Probably it's more troublesome for newbies but
that's something they should write down.).
Summary: 9 out of 10 points (using int; using double I'd make it
9.5 *g)
Sorry, this is a long and big post. But then, so too is my way
that led me here; long, big, troublesome. And I thought that my
(probably not everyday) set of needs and experiences might be
interesting or useful for some others, too.
And, of course, I confess it, I just feel like throwing a very
big "THANK YOU" at D's creators and makers. Thank you!
More information about the Digitalmars-d
mailing list