From: dfan at harmonixmusic.com (Dan Schmidt)
Date: 30 Apr 1999 10:18:14 -0400
Subject: while (a=b()) ...
References: <XFMail.990429164839.nathan@islanddata.com>
Message-ID: <wkr9p242ft.fsf@turangalila.harmonixmusic.com>
Content-Length: 1161
X-UID: 1130                                                  

Nathan Clegg <nathan at islanddata.com> writes:

| I have some deep-rooted "hates" in programming and don't even know
| where some of them came from.  One of them is "while 1" loops.  They
| seem somehow at the same level as goto statements and should be
| used, in my mind, about as rarely.
| 
| The ideal, of course, would be:
| 
| while (c = curs.fetchone()): ...
| 
| That is my only complaint about python, that statements cannot be
| expressions.

Everyone who is at all interested in loops should read Knuth's article
"Structured programming with go to statements", found in his book
"Literate Programming".  Don't be fooled by the title or the fact that
it was written in 1974.  It's a comprehensive (70 pages) overview of
looping constructs, including convincing proposals for some new ones.
Certainly all language designers owe it to themselves to read it.

-- 
                 Dan Schmidt -> dfan at harmonixmusic.com, dfan at alum.mit.edu
Honest Bob & the                http://www2.thecia.net/users/dfan/
Factory-to-Dealer Incentives -> http://www2.thecia.net/users/dfan/hbob/
          Gamelan Galak Tika -> http://web.mit.edu/galak-tika/www/




