gregj at pobox.com
Wed Dec 20 07:49:18 CET 2000
"Jay O'Connor" <joconnor at cybermesa.com> wrote in message
news:mailman.977283904.26696.python-list at python.org...
> Why are we still maintaining these leftover idioms such as using
> integers as booleans. If we are to carry the state of the art of
> programming beyond it's current level, we need to be programming a t a
> higher level of abstraction than is easily supported while still
> dragging anachronisms such as this around.
> Those who claim that 'while 1:' is obvious, it's not.
> It's only obvious if you've programmed "C" and other such languages.
> It's makes no sense really, unless you've learned the 'code
No one claimed "while 1" is obvious, only that it's a idiom of the language
(and idiom shared more or less with C and C++). It's something you figure
out once in your programming career, and then it's "obvious" forever after.
I don't think that the complaints about "while 1" spring from confusion
about what it means, but a mistaken aesthetic offense at Python's idiomatic
"while 1: ... if condition: break ..." loop. Other languages handle this in
their own way, and have their own idioms, but they are no more or less
"obvious" than Python. Blaming C and C++ isn't fair; in those languages
expressions have a value, so richer looping expressions are possible and
"while (1)..." is less common.
Very little of any programming language is obvious until you've learned the
syntax and the idioms. Just because Ada and Smalltalk have boolean types
doesn't make Ada or Smalltalk code any more obvious to someone who doesn't
know the language
> My first professional language was Ada83. From there I went to
> Smalltalk. When I finally started working with languages such as C,
> C++, etc... I was at first confused ( while (1)...what does that mean)
> and then revolted.
> I'm continuously amused that people try to take language design forward
> and still drag obsolete ideas along for the ride.
I am on safe ground pointing out that C and C++ have enjoyed somewhat
greater success and wider adoption than Ada and Smalltalk, so perhaps those
obsolete ideas aren't so bad after all.
Portland, Oregon, USA
gregj at pobox.com
More information about the Python-list