Python vs. Perl, which is better to learn?

Donn Cave donn at u.washington.edu
Wed May 8 13:24:49 EDT 2002


Quoth Max M <maxm at mxm.dk>:
...
| Well ... not to keep flogging a dead horse, but you have only prooved 
| that you work on problems where Python is not fast enough. And that 
| there are other people needing all the horsepower they can get.
|
| What you have failed to show is the ratio between programming problems 
| that needs the speed of c/c++ and those where Python is fast enough.
|
| As long as we have no hard data it is purely anecdotical evidence, which 
| is next to useless.

It's probably a useless question.  Is Python fast enough, or do you
need a faster language?  This isn't a Yes or No question, it's a
trade-off.

Compared to Language X, Python will have certain advantages and
disadvantages.  Performance will always be among the issues, if
we're talking about evaluation with any serious intent to produce
usable software - always.

If Language X is so atrocious that you're determined to use Python
if at all possible, then that sets the bar pretty high.  Even if
Language X programs run substantially faster, and even if your
computing environment is going to be severely taxed, you still may
be better off with Python.  So you solve your problem with faster
hardware, or you work harder to exploit whatever efficiencies Python
can offer.  In the end, very rarely will you "need" Language X.

But that's a big "if".  I think more commonly, we find some advantages
to Python, but they aren't _that_ compelling.  (I'm talking about people
who don't spend half the day on comp.lang.python, of course.)  Then,
speed starts to be an issue.  Rather, it's the issue it has always been,
but it does influence choice of implementation language.  People are
definitely willing to pay a price for faster software, the only question
is how big a price.

I personally think the price is too big for Perl, but I've seen people
learn Python and then decide otherwise.  It's important that people
understand the price they're paying - the real problems that Perl
programmers have in the long run - but let's not get carried away,
Perl isn't necessarily a fatal choice.  Nor is C or even C++.  And
of course those aren't the only languages that can be faster.

A useful advocacy posture is to make sure Python's getting a fair
break on the speed issue, and then emphasize the other compensating
advantages.  Dismissing speed as a foolish concern gets no one anywhere.

	Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list