allowing braces around suites

Andrew Durdin adurdin at gmail.com
Sat Aug 28 18:40:33 EDT 2004


On Sun, 29 Aug 2004 00:12:32 +0200, Christophe Cavalaria
<chris.cavalaria at free.fr> wrote:
> 
> Well, there are worse coding conventions than that. Remember that chaining
> unbraced if and else if becomes ambiguous.

Oh yes. I was bitten again by that just a couple of days ago. I had:

if(sometest)
    do(this);
else
    do(that);

And needed another (separate) test for do(this), so naturally changed
the code to be:

if(sometest)
    if(othertest)
        do(this);
else
    do(that);

It made me wish I was writing the program in Python -- no silly braces
to have to put in there :)



More information about the Python-list mailing list