two ideoms at one blow: line-reading and regexp-matching

Delaney, Timothy tdelaney at avaya.com
Sun Mar 24 18:19:07 EST 2002


> From: Clark C . Evans [mailto:cce at clarkevans.com]
> 
> I'd note that good "C" style is to always put the constant
> as the LVALUE in this way the above looks "funny".  In
> other words when checking for equality in C, write "if (3==a) {"
> this way if you forget the extra = you don't shoot yourself
> in the foot (it is a syntax error).  A good lint program
> should be able to flag these cases for you.  After a while
> any equality test where the variable is on the left just
> "looks funny"... 

if (b = a)
{
}

Where's the constant?

Tim Delaney




More information about the Python-list mailing list