Python Rocks!

Tom Culliton culliton at clark.net
Mon Jan 17 23:28:40 EST 2000


In article <860ftk$bas at news.or.intel.com>, tye4 <tye4 at yahoo.com> wrote:
>I'm a python newbie.. but I like Python better than Perl (no ugly @$#@.. in
>syntax).
>
>Python does have one quirk: no end if or end loops
>
>if x == 10:
>    print 'x is 10'
>print 'Hello world'
>
># easy to get confused whether this line is in 'if' block or not
>Having an 'end' block would help tremendously.

Are you serious or are you trolling?  I can see the end of an indented
block without my glasses, even when the text is an indistinguishable
blob.  It can't get much more obvious than that.

BTW - Python has several much stranger quirks.  Things that it will
take you much longer to notice, may puzzle, bemuse, or startle you,
and when you finally understand why they are the the way they are will
give you a deeper insight.  The way "assignment" really works is one
of my favorite examples.

>if x == 10:
>    print 'x is 10'
>end if
>print 'Hello World'
>
>or
>for x in range(1, 10):
>    print x,
>end loop

Try:

# end if
# end for
# end while

This has the advantage that it will work NOW with no ugly changes to
the language for those of us who consider this rank sillyness.

>Indentation is a confusing and lame way to separate what is inside a block
>and what's outside it.

Uhm, ... I'll be polite ... Try it.  You might be suprised how fast it
grows on you.  If you still find it confusing after a couple of weeks
of real use, I'd suggest looking for another language to use.  Beyond
that, it's fairly impolite for an admitted newbie (meaning you are
admittedly ignorant of python style, idiom and philosophy) to start
throwing around fairly radical suggestions.

Have you got extensive experience at designing and implementing
computer lanaguages like Guido?  Did you spend years working on a
major language design/development project (ABC) including lots of
usability studies like Guido?  Have you had the benefit of Tim Peters,
a veritable font of language implementation experience and good taste,
whispering (or occasionally shouting) in your ear?  I rather doubt it.

Part of the reason that Python is so clean and elegant is because
Guido, with that background, discarded everything that didn't improve
clarity, conprehensibility, and ease of learning, and only kept things
that helped.



More information about the Python-list mailing list