Looping constructs
Michael Kelly
mkelly2002NOSPAM at earthlink.net
Mon Dec 24 19:26:36 EST 2001
On 24 Dec 2001 16:27:25 GMT, beej at piratehaven.org () wrote:
>Do you ever have a "while 0:" loop? Of course not. So why is there
>even a conditional in there at all? Shouldn't Python just have a:
>
>foreverloop
Heh. I've even seen C guys do macros like
#define FOREVER for(;;)
(but they usually came over to C from Pascal
or Modula or someplace)
A bit silly after a while. AFAIC it doesn't
really matter that much. One thing I did
like about Quick Basic and now VB is
that you can put the conditionals at the
top or bottom of the loop and with positive
and negative logic for both, but as long as
you have break and continue type statements
it doesn't really matter.
What messed things up in C/C++
was any non-zero function return was
"true" so then they figured it would be
nice to return the error code and return
0 for "success" so everything stood on
its head. Then they did exceptions so
they really don't need the 0 success returns
after all(unless you don't want to use exception
handling.) Then of course there's COM with
zero success and exceptions too. Ugh! :)
The only thing that seems to stay the same is
that as soon as you got something down they
change it on ya'. :)
Mike
--
"I don't want to belong to any club that would have me as a member."
-- Groucho Marx
More information about the Python-list
mailing list