Why should I switch to Python?

Grant Griffin g2 at seebelow.org
Wed May 10 17:22:18 EDT 2000


Aaron Turner wrote:
> 
> A friend of mine is trying to convince me we should
> do a project using ORBit in Python.  I've been
> coding Perl for over 3 years and really like it.
> (Especially it's syntax and ability to grok my
> programming style.)  Now, I understand the Perl
> vs. Python war and everyone has their preferred
> taste in the matter.
> 
> What I'd like to hear from people is what technical
> resons I should switch to Python.  Are there any
> features that Python has (perhaps in it's OO
> offering) that Perl lacks?  From what I can tell
> people tend to prefer Python over Perl mostly
> for its syntax, which I find very likable.

Like you, I have been doing Perl for about 3 years.  It's a wonderful
thing for what it is, but having discovered Python, I now consider
myself a "Perl Refugee".  Python is like Perl--except without so much
"Perl".  What could be better?!

I never became totally comfortable with Perl (has anybody?), but I got
totally disillusioned with it when I tried to write my first
"medium-sized" program in it.  I found it didn't scale well in terms of
maintainability.  Specifically, Perl is the only language I've ever used
wherein I found it hard to read my own code (except assembly, of course.
;-)  So I got in the habit of trying to put in nearly one comment per
line (like assembly, of course.)  But that's going in the wrong
direction.  Obviously, comments should be used only to mitigate the
problem of the code failing to explain itself.

Although I'm a veteran C++ programmer, I never did "grok" (as you people
say ;-) its class system.  Obviously it's bolted onto the side, not
designed in from the start.  I bought the book "Advanced Perl
Programming" to try to finally "get over the hump" on Perl classes.  But
the author of that book says something to the effect that Python is his
favorite OO scripting language.  So let's try Python.

Genius is the art of simplicity, and Python is a work of great
simplicity.

After spending one full day with Guido's tutorial, I felt like I
pretty-much understood it.  As an early learning project, I translated a
little C++ implementation I had written of the CORDIC algorithm into
Python, implemented as a class.  After I got it working, I wondered,
"where did all my code go?".  I had done some powerful stuff with very
little code.  And it read like butter.  I was in love.  <gush>

Others have suggested that one should "use the best tool for the job". 
That's valid, but I suspect that the preference for Perl, Python, or
whatever is an expression of one's personality more than anything.  Perl
people seem to take pride in being "hackers", and they seem to revel in
the high-wire-act-without-a-net aspect of it.  But since I'm not trying
to impress anybody in The Software Big Top, I'd rather walk the wire
using a big pole, a safety harness, a net, and with the wire not more
than 3 feet off the ground.  I don't get hurt that way.  Readable code
is the 3-feet-off-the-ground part.

Therefore, to me, "the best tool for the job" is usually the thing that
lets me write the most readable code.  That's Python.

tom-christiansen-is-an-expression-of-_perl's_-personality-<wink>
   -ly y'rs,

=g2
-- 
_____________________________________________________________________

Grant R. Griffin                                       g2 at dspguru.com
Publisher of dspGuru                           http://www.dspguru.com
Iowegian International Corporation	      http://www.iowegian.com



More information about the Python-list mailing list