First day beginner to python, add to counter after nested loop
Antoon Pardon
antoon.pardon at rece.vub.ac.be
Sun Nov 3 06:33:56 EST 2013
Op 02-11-13 21:19, Tim Roberts schreef:
> jonas.thornvall at gmail.com wrote:
>>
>> I certainly do not like the old bracket style it was a catastrophe, but
>> in honesty the gui editor of python should have what i propose, a parser
>> that indent automaticly at loops, functions and end.
>
> Many editors do that. Vim, which is what I use, certainly does.
>
>> I promise you it will save millions of hours of bug searching all over
>> world in a month.
>
> I suspect you meant "dozens" rather than "millions"...
>
> Look, both schemes have their pitfalls. With an "end" requirement, it's
> easy to have code where the indenting doesn't match the actual nesting, and
> that causes human confusion.
Not really. All examples of this kind of confusion I have seem come from
C where the problem IMO comes from the fact that people can choose to put
one statement after a control structure or a block.
I have programmed sometime in modula2 and this mismatch was just not a
big deal in that language because such a mismatch usualy resulted in
an end missing and the code not compiling, which resolves the confusion
rather quickly.
Now of course I can mis something. Maybe you can provide an example that
would be confusing even with modula2 kind of control structures and still
compile and produce a hard to trace bug.
--
Antoon Pardon
More information about the Python-list
mailing list