Why I chose D over Ada and Eiffel

Ramon spam at thanks.no
Tue Aug 20 09:40:19 PDT 2013


Yes and no.
While UTF-8 almost always is the most memory efficient 
representation of anything beyond ASCII it does have a property 
that can be troublesome a times, the difference between length 
and size of a string, i.e. the number of "characters" vs. the 
number of bytes used.

---

As for another issue I'm getting more and more disappointed: 
generics.

To put (my mind) bluntly, D does *not* support generics but 
rather went into the same ugly trap C++ went into, albeit D 
handles the situation way more elegantly.

Forgive me seeming harsh here but I just wrote it in the D gui 
thread: Any really great solution needs a solid philosophy and 
very profound thinking and consistency - and here D failed 
bluntly (in my minds eye).

With all due respect: Templates are an editors job, not a 
compilers.
Yes, templates offer some gadgets beyond simple replacement but 
basically they are just a comfort thingy, relieving the 
programmer from typing.

That, however, was *not* the point about generics. They are about 
implementing algorithms independent of data types (as far as 
possible).

Now, I'm looking around at mixins and interfaces in order to 
somehow makeshift some kind of a halfway reasonable generics 
mechanism. Yuck!

Well, maybe it's my fault. Maybe I was foolish to hope for 
something like Eiffel but more pragmatically useful and useable, 
more C style and way better documented. What I seem to have found 
with D is a *very nice* and *way better* and considerably more 
useful kind of C++.

Why aren't real generics there? I mean it's not that high tech or 
hard to implement (leaving aside macho bla bla like "It'd break 
the ranges system").

why not something like

generic min(T:comparable) { // works only with comparable 
types/classes
   // min magic
}

This could then at *run time* work with anything that met the 
spec for "comparable" which basically came down to anything that 
offers "equ" and "gt" (and "not").

On a sidenote: It seems we are somehow trapped in between two 
worlds, the theoreticians and the pragmatics. Walter and his 
colleagues have created an astonishingly beautiful beast coming 
from pure pragmatic engineering, while e.g. Prof. Meyer has 
created a brilliant system that just happens to be factually 
unuseable for the majority of developers (and be it only because 
hardly anyone will spend some 1.000$ to get started with Eiffel).
It's as if one side a purely as engineers while the other side 
just didn't care sh*t about their stuff being useable and useful.

My sincere apologies if I happened to offend anyone; that was 
definitely not my intention.


More information about the Digitalmars-d mailing list