On Sun, Aug 30, 2009 at 7:13 AM, grauzone<n...@example.net> wrote:
>> Although teeeeeeechnically speaking that would be illegal code. The D
>> spec says that it's not legal to use the value of uninitialized
>> variables. Default initialization is kind of a poor man's substitute
>> for actual flow control which determines that. By relying on default
>
> Am I the only one, who likes the current behaviour, and finds it annoying to
> be forced by the compiler to initialize all variables?

The default initialization in D certainly hasn't helped me catch any
bugs, only made them harder to spot. I'm a very big proponent of
catching things at compile time.

>> initialization, you're relying on what is actually nonconformant
>> behavior, and it could be broken in the future or by a smarter
>> compiler.
>
> How is this nonconformant? Initialization is guaranteed by D.

This is where the spec is unclear, since why bother having the "can't
access variables before assignment" rule if the "all variables are
default-initialized" rule all but removes the need for it?

Reply via email to