Python vs. Perl, which is better to learn?

Roy Smith roy at panix.com
Mon May 6 07:13:12 EDT 2002


Chris <chris at cmb-enterprises.com> wrote:
> I would have agreed a few months ago.  However, once you understand how 
> to write modules in Perl, and how Perl's take on OO works, it becomes 
> much easier to create large projects.

I hated Perl when I first learned it, but felt a little guilty because what 
I really hated was the "it's one huge script with globals everywhere" style 
used by the programs I worked on while learning the language.  I had this 
nagging suspicion that OO Perl would be much better.

So, a while ago, I started on a major Perl project of my own.  Decided to 
do it right, with modules to do various tasks, OOP, etc.  You know what?  I 
still hate it.  The language is certainly a lot better when you use good 
program design techniques, but it's still pretty ugly.

One thing that kept getting me messed up was forgetting whether I was 
passing an object or a reference to an object.  I had plenty of each.  It's 
just like C pointers all over again.  In Python, an object is an object.

In Python, if I ever get lost in a sea of confusing data structures, it's 
easy to just into an interactive session, run my program up to a certain 
point, then mess around with type() and dir() and see what I've got.  Being 
able to define __str__() methods for all my classes means it's easy to just 
stick in a print statement and not worry about the details.



More information about the Python-list mailing list