On Fri, 27 Jul 2012 06:36:57 +0200, Alex Rønne Petersen <a...@lycus.org> wrote:

Jumping over initialization isn't as problematic in D because variables are guaranteed to have a default initialization value (if not initialized to void).

And how is that supposed to work, when you just skipped that piece of code?


It's worse in languages like C where the value of variables would be
undefined.

It's *better* in languages like C, where the value of the variable would be
undefined anyway, so you'd have to deal with that anyway.

I would go as far as to say this is part of the reason this is in the spec:

"It is illegal for a GotoStatement to be used to skip initializations."[1]


[1]: http://dlang.org/statement.html#GotoStatement

--
Simen

Reply via email to