Changeset 442, implicit Vs explicit

bearophile bearophileHUGS at lycos.com
Tue Apr 27 07:34:22 PDT 2010


Walter Bright:
> The idea is that for long arrays, often only the start of it needs 
> initialization to anything but 0.

I got the idea well, but my idea is that it's bug-prone syntax, because it's partially implicit (I have put a bug in a program of mine because of that syntax).
How often do you need that? Is such frequency worth the risk? Can you tell me some cases? I have not had to use it so far :-)
And the syntax like the arr[$] = [...] can avoid some of those bugs because you don't need to count items.

And even if you are right, and it's a common need (other people here can confirm), then I am asking for an explicit syntax to ask for a partial initialization, to avoid bugs.


>C99 supports it as well.<

C is known to be the less safe language among the ones used today (today people use C, Java, C++, C#, VB, JavaScript, PHP, Python, Perl, Ruby, Delphi, etc).

Bye,
bearophile



More information about the Digitalmars-d mailing list