Public outcry -- maybe not?
Jari-Matti Mäkelä
jmjmak at utu.fi.invalid
Tue Jul 3 02:04:43 PDT 2007
kris wrote:
> For example, suppose I'm
> maintaining some code that looks like this:
>
> # int x;
> # x = 42;
>
> and decide that those ought to be folded together while I'm cleaning up
> something else? Ouch! Potentially nasty bug
>
> In other words, assigning .init values should be associated with
> type-declaration only, and not with type-instancing. This is a simple
> rule to comprehend - one that gravitates toward the principal of least
> surprise?
I agree with this too. Those initial values could be placed to a constant.
Language consistency is more important than avoiding the need for very
little extra typing.
More information about the Digitalmars-d
mailing list