Concrete Proposal: while ... and while ...

Graham Matthews graham at sloth.math.uga.edu
Thu May 20 14:42:08 EDT 1999


Michael P. Reilly (arcege at shore.net) wrote:
: Seriously, a very well-defined, simple concept for iteration is
: recursion: in some form most any application for a loop can be
: expressed as some form of recursion (except in Fortran ;).  In many of
: the right applications, recursion is easy-to-follow, intuitive and more
: efficient.  Recursion (usually) requires no change in the language to
: impliment.  Why don't we use recursion more often?  I think when people
: answer that question themselves, they'll probably understand my point.

People don't use recursion much because most people are taught iteration
before recursion and hence find recursion somewhat unnatural. Those who
learnt recursion first find iteration to be clunky (for example recursion
is much more amenable to proof, and recursion corresponds more naturally
with sub-problem decomposition). 

However I think Michael's point is well made, namely that changing the
while syntax (even without breaking code) is pointless. People using
Python, and newbie users, are quite comfortable with

	while 1;
		...
		if test:
			break

Why change what the vast majority of Python users find comfortable?

graham

-- 
                         On the streets tonight
                         The innocent are dying
                        And the world's not right
                         So many millions dying




More information about the Python-list mailing list