Sorry for my 2nd intervention on this thread. I recently ported
some (not much) code from C to D. My impression was that D(2)
tries to be too many things at once. I even considered porting to
D(1) instead of D(2). What attracted me into the first place to D
was it promise to be a "better C" (and a better C++), at least
this is I saw it. However, it seems to have grown too complex to
me. Yes, I understand that new, modern features should be
provided by the language, but I do not like to be forced to use
those.
From my (limited) background, what I really liked in D:
*the new type[n] and type* declaration syntax
*the templates syntax (that's a biiig plus)
*other things that I do not remember now, but they are plenty of
them
*the fact that constructors and destructors do not need renaming
when class name changes (I hated that in C++ and Java), although
I would have liked more special kewords like "ctor()" and
"dtor()", instead of "this()" and "~this()", but I can cope with
that)
What I did NOT like in D (is my impression):
*the confusion between . and -> operators (yes, I know the latter
does not exist in D, is just for talking first here) for classes
and structs and why classes are or are not pointers and why
structs behave differently (or, at least, this is how I perceive
it) and why not the pointer syntax is not used if they are
pointers (well, references) and so on (yes, I am a bit dizzy, but
is not entirely my fault; it's also D's).
*the many @ annotations that is not clear if they are compulsory
or not (and, if not, how to convince me to use them...)
*the writing of the p[0..len] that you need to use when some
other code (C code) passes you the pointer to data and the length
(I just do not like it)
*it is also my impression that you cannot declare int[]
x=<<some_initialization>> as a static array with length filled in
by compiler at the compile time, since the length is known?
instead, x is interpreted as a dynamic array (which, also, I do
not like that same syntax, or very similar, is used for both
concepts).
*the fact that the calling of a function bears no indication if
you modify or not the passed variable (I much prefer the C-ish
style of foo(a,&b); where you *almost* know that b will be
modified)
Well, these are some. I feel that the right line is somewhere
between D1 and D2. It is good that advanced, complex features are
present in D, I just not want to be forced to use those when
porting "traditional" C code.
I expected to meet D and exclaim: wow! C++ done right! Instead, I
feel like being forced to learn another, completely new paradigm
language, like I would start with Lisp or something else.
Remember:
"Within D, there is a much smaller and cleaner language
struggling to get out".