One document about Go
"Jérôme M. Berger"
jeberger at free.fr
Tue Jun 1 13:41:00 PDT 2010
Walter Bright wrote:
> bearophile wrote:
>> Alex Makhotin:
>>> Current DMD compiler version outputs on attempt to make empty statement:
>>>> use '{ }' for an empty statement, not a ';'
>>> Is there a reason?
>>
>> Yes, it avoids a common type of bug:
>>
>> for (int i = 0; i < 10; i++);
>> writeln(i);
>>
>> I have seen students waste minutes locating that bug.
>
> I've seen a whole afternoon lost on that one.
Of course, using a decent editor will prevent it: if the editor is
able to handle indentation correctly, it will indent the writeln in
the same column as the for which makes the problem appear immediately.
Jerome
--
mailto:jeberger at free.fr
http://jeberger.free.fr
Jabber: jeberger at jabber.fr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20100601/9dc85d29/attachment.pgp>
More information about the Digitalmars-d
mailing list