A defense for bracket-less code

Edward Elliott nobody at 127.0.0.1
Wed Apr 26 14:09:15 EDT 2006


Dave Hansen wrote:
> Not really.  It was mostly a lead-in to that last sentence.  Problems
> like this couldn't happen in Python.  So it's an opportunity to get a
> giggle at the expense of programmers using a language that gives you
> enough rope to shoot yourself in the foot...

Which can be entirely avoided by making the braces mandatory rather than
optional.  This is one thing perl got right:

while (foo);            # parse error
while (foo) next;       # parse error
while (foo) { next; }   # ok
while (foo) { }         # ok

And if you compile C++ without a lint checker, well, you're playing with
fire. :)




More information about the Python-list mailing list