[Tutor] getting started

Magnus Lycka magnus@thinkware.se
Sat Nov 16 05:07:02 2002


At 07:06 2002-11-16 +0100, Gregor Lingl wrote:
>Nevertheless: if you write
>if 1==1:
>don't you suppose this to be easier to understand than
>if 0==0:
>(or: if 6==6:)? So, apparently, you assume that the reader knows,
>that 1 means True in Python.

I just tried to assume as little as possible.

>IMO it's worth to try to avoid, that beginners develop the often
>seen habit of using idioms like
>if done == 1:  versus if done == 0: etc.

Agreed.

if hasFoo():
     doThat()

is better than

if hasFoo() == 1:
     do That()


-- 
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se