Does D have too many features?
Simen Kjaeraas
simen.kjaras at gmail.com
Mon Apr 30 17:16:47 PDT 2012
On Tue, 01 May 2012 01:20:53 +0200, akaz <nemo at utopia.com> wrote:
> *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).
Really? This is one of the big pluses to me.
> *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)
While I can agree it's not perfect, I have a hard time seeing a better
solution. Somewhere the information has to be combined to create a proper
array.
> *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).
Agreed.
> *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)
Yeah. C# truly got this right with its enforcement of marking passed
parameters ref or out. I'd really like that for D too.
More information about the Digitalmars-d
mailing list