Python praise [was Re: two ideoms at one blow ...]

François Pinard pinard at iro.umontreal.ca
Wed Feb 20 20:52:52 CET 2002


[Russell Nelson]

> Hello, François.  Yes, I discovered Python about a year ago [...] I thought
> that was a great idea ... and then much later I discovered Python using
> those rules.

I wish you will be happy with Python.  For one, I'm very, very satisfied,
to the point I lost much of my interest for C programming (and away from
all those heavy portability efforts that plague most of my previous works).

Python is excellent for quickly writing prototypes, and moreover, for reading
them back while revisiting them later.  This is especially important for
code that you (or I) write quickly, because you (I) have less time than
usual for learning what we do while doing it, per our previous habits.
When I was writing a lot of assembler, I was meditating for weeks on the
code and the project.  When one writes equivalent code in one hour or so,
one surely looses something.  To counter-balance, Python could be written
very legibly all along.  Of course, a minimum of comments always help. :-)

And you know, prototypes that work well enough often turn into production
programs, that stay un-rewritten forever, and with everybody staying happy.
If arises a special need for extra speed, a few profiling runs, followed
by the writing of a specialised C extension, is often the good way to go.

There are many Python libraries (or modules, or packages) already, they
may not be as numerous as in some other languages, but on the other hand,
many of them are extremely well designed, and are pure pleasure to use.  In a
way, my feeling is that in Python, there is less garbage to chose from :-).

Yesterday, I was playing with PIL (Python Imaging Library) and PyFT (Python
Freetype interface) in various ways, and found astonishing how easily one can
get a lot of quality out of relatively short Python programs (also provided,
in this case, that both packages allow easy handling of alpha channels).
This has been my experience all along with Python, and in various fields.
Lot of results for modest investments in code which always stay legible.

I somewhat regret having discovered something like Python so late in my
programmer life.  On the other hand, I guess that younger people, lacking
experience, may not fully appreciate the worth of the tool given to them...

In a word, Nelson, welcome in the gang! :-)

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard





More information about the Python-list mailing list