One document about Go
Simen kjaeraas
simen.kjaras at gmail.com
Tue Jun 1 15:01:54 PDT 2010
Jérôme M. Berger <jeberger at free.fr> wrote:
>>> 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.
No. Having been a programming teacher, I can assure you that beginners
/will/ make this mistake, no matter how much the IDE helps them. If the IDE
does not indent things the way they expect it to, they will 'fix' it.
Having worked with auto-indenting editors myself, I have to say they are
the work of devils. They tend to indent seemingly at random, and choose the
most unpleasant ways if they feel they can get away with it.
And should you for some obscure reason want to use a different indentation
style (say, you've downloaded some code), it will be as confused as a
non-geek doing the motherboard dance.
--
Simen
More information about the Digitalmars-d
mailing list