Choosing Perl/Python for my particular niche

Robin Munn rmunn at pobox.com
Tue Mar 30 13:00:51 EST 2004


Fred Ma <fma at doe.carleton.ca> wrote:
> Hello,
>
> This is not a troll posting, and I've refrained from
> asking because I've seen similar threads get all
> nitter-nattery.
[snip: poster is basically asking "Should I learn Perl or Python?"]

While availability of libraries for your specific tasks is a major
factor to take into consideration, I'd say that even more important is
to figure out which language fits your brain.

I first learned Perl, then Python. I now use Python almost exclusively,
because I found that Python fits my mental "map" much better than Perl
does. To me, it seemed like in Perl, everything was a string. Sure, you
could have objects and classes, but they felt strange and awkward -- how
do I translate the "bless" keyword into my mental model? Whereas
Python's object model translated perfectly into my mental map, to the
point where programming in Python gave a clarity that I never had when
using Perl. It's hard to explain why, exactly -- it just seemed like
when using Perl, I was always going back down to the level of details,
the trees in the forest. Python allows me to look at the entire forest.
I can still go down and look at trees if I need to, but I don't have to
operate in that mode all the time.

Your mileage *will* vary. There's no substitute for experience. Set
yourself a simple task (say, writing a sieve of Eratosthenes program)
that you could do in about an hour with a language you're familiar with.
Then write the same program in Perl and in Python, and see which one
fits *your* brain better.

-- 
Robin Munn
rmunn at pobox.com



More information about the Python-list mailing list