Python vs. Perl

François Pinard pinard at iro.umontreal.ca
Tue May 22 19:44:03 EDT 2001


[Jonathan Gardner]

> I like the simplicity of everything - the way almost anyone can
> understand it.  (Is this a feature or a bug?)

I consider it to be a very appealing and worthy feature that Python stands
in a niche similar to Perl, while being so readable.

> What does Python have that makes it so great?  [...] I am looking for
> comments from people that actually have used Perl or C/C++ extensively,
> and I am looking for comments that go beyond the FAQ.

An humble syntax which is nevertheless very effective.  I rewrote tens of
thousands of Perl lines into Python, and do not have the shadow of a regret
(besides the human aspect of Larry Wall, who I always appreciated -- but
since his personality is almost fully buried in the Perl crowd and riot,
I did loose the pleasure of Larry long before switching away from Perl).
Going to Python, code acquires much light and clarity, and maintainability.

Python also got me to loose most of my interest in C programming.  I still
do it once in a while, because some special applications might need C speed
here and there, yet much less often in practice than one might think.
Prototyping a program in Python is a lot faster than in C, code is more
solid right on the first writing, at least because it is so more legible.
Debugging is much easier anyway, for when bugs remain.

One thing that I especially appreciate, but this is a relative detail, is
how error processing works in Python.  In Perl or C, an error is usually
ignored unless you take action to act on it.  In Python, you have to take
positive action if you want an error to be ignored.  That single point
makes Python programming, even lazy, a lot safer than Perl or C.

Another point, which I often notice by comparing my Python code to C coders
around me, which are very competent people in my opinion, is that they
are more reluctant than I am resorting to hashing, threads, client/server
design, and other such things, at least for simpler or less important
projects.  While these things are quickly and simply written in Python,
they always require some amount of courage in C.  Perl is easier than C,
yet Perl code gets a bit discouraging too when times come to read it back,
enough to become an impediment in bigger or more serious projects. :-)

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




More information about the Python-list mailing list