Python is Zen (was Python is wierd)

Richard P. Muller rpm at wag.caltech.edu
Thu Jul 27 12:16:05 EDT 2000


Rather than reading a book, I would suggest you just dive in and start
programming. I thought some of Python's features (whitespace
sensitivity) were laughable when I first heard of them. 

Then I started programming in Python. There is an elusive simplicity to
the language that is hard to capture in any book. The reason for the
points you make below is that most of the time, be it in passing
arguments or declaring variables (BTW, I think that the various uses of
the 'static' command are one of the worst features of C/C++/Java, and
I'm glad to be rid of them all), Python automatically does this
correctly. This can be frustrating when it doesn't (I've had all kinds
of problems with copying), but the nice thing is that by the time you
encounter these special cases, you've already programmed enough and
you're comfortable enough with the language to hack around them.

One of these days I'm going to write an article called "Zen and the Art
of Python". In the meantime, I'll leave you with this quote, taken from
the PythonLabs website:

"Python is the most efficient language I've ever used. It's 10 times
better than any of the other tools I have used. It's free, it's
object-oriented, it adapts to everything, it runs on everything. There
is almost an indescribable 'quality without a name' attraction on my
part."
 --Bruce Eckel, Author of Thinking in Java

Jonathan wrote:
> 
> Hi, just finished going through the 'Learning Python' book, and the
> feeling that i get is that Python is really wierd(compared to other
> conventional languages like C++, Java, etc). For e.g.(correct me if i'm
> wrong)
> 
> 1. There are no keywords to declare static or instance variables; it
> all depends where they are placed(whether it's right after the <class>
> statement, or inside a <def>). Isn't it harder for other programmers to
> know at one glance what type of attributes the class define?
> 
> 2. No *formal* declaration of static class methods, e.g. no 'static'
> keyword (though i'm not sure how useful static methods are in OOP
> design). I read somewhere in this newsgroup that the workaround way is
> to define the method outside of the class - doesn't it break
> the 'encapsulation' a class suppose to have?
> 
> 3. No keywords to differentiate between passing arguments by reference
> or value! An integer is passed by value(reference to a new copy), while
> a mutable object is by reference. To pass a list by 'value', i know you
> just need to insert one more line(list = [:]), but it seems
> so 'inconsistent' compared to Java or even PHP.
> 
> (Not to mention the number of 'gotchas' listed in the book that are
> bound to trap beginners - *shudder*)
> 
> The reason i'm picking up python is that i got sick of PERL:), and
> don't really like the inflexible typing of Java. Furthermore, some ppl
> claim that Python is easier to learn, enables you to write much cleaner
> codes... However, after reading the python book, my head is still
> spinning, trying to catch all the 'intricacies' of this language. No
> doubt it will be a powerful and useful 'tool' to me once i get used to
> it; but i don't think it's suitable to be a first programming language
> for non-programmers(i read somewhere about this project going on).
> Pascal(for procedural) and Java(for OOP) is still the better choice to
> start off, IMHO.
> 
> regards,
> Jonathan
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.

-- 
Richard P. Muller, Ph.D. 
rpm at wag.caltech.edu 
http://www.wag.caltech.edu/home/rpm



More information about the Python-list mailing list