Languages for bioinformatics

Andrew Dalke dalke at ks.uiuc.edu
Tue Mar 3 05:07:16 EST 1998


Richard P. Grant <rgrant at cmtech co uk> asked:
> OK, that's pretty convincing.  Now tell us, be honest, the downsides
> of Python vs Perl.
> (This is a genuine request, not flame bait)

(I'll see when the wires start burning :)


  I wasn't able to come up with many; most are related to perl's
existing prevalance.  Perhaps someone else has a better list?

                    Downsides of Python v. Perl:

1) regular expressions are not as fast as perl4 or 5.  As I aluded to
at the end of my earlier email, I did some tests of the (new) re
module in python (uses the "perl 5 compatible regular expression
library").  In the domain of Prosite regular expressions, it had about
1/2 the performance of perl5, which itself had about 1/2 the
performance of perl4.
  (The re module is new, so its performance is likely to get better.)

2) Regular expressions aren't as easy to use in python as perl.

3) beginners to python don't like whitespaces, which turns some people
off.  It takes a bit of getting used to, but then people like it (I
don't know if this is a downside or not)

4) one-liners in Perl are highly useful in Makefiles, system() calls,
etc.  For example:
   perl -pei.bak 's/this/that/g' *.txt
does an amazing number of thing

5) I've used perl a lot longer than python so it is still easier to
get a lot of small things done in perl.

6) It is more likely that perl is available on a customer/remote
machine.  Only linux systems ship with python (that I know of) while
SGI has shipped perl for several years and perl is usually available
as a "freeware" disk for other OSes.

7) There isn't a Python equivalent to CPAN; ie, a common place for
people to go and find extensions and modules.

8) There are many contributions to CPAN.  (On the other hand, I'm
looking at the CPAN list and there are a lot of modules that aren't
needed for Python, like Class::Template, Data::Dumper and Ref, and
it is quite easy to integrate Python with existing C code.)

9) Python namespaces are a bit strange in that there are three scopes
(local, class and global) and no more.  But then Perl's are strange.

10) Perl has closures while you can emulate them in Python with a
Schwartzian transform (don't ask me, I'm quoting from what I read
elsewhere!).

11) Python doesn't have "real" private members (though it can be
emulated).  But then, neither does Perl. And it is easy to fake C++
out about that.


  You might want to read http://www.python.org/python/Comparisons.html
(bear in mind some of the evaulations are 2+ years old and some things
have improved since then.

BTW, for a fun observation, look at http://www.tpj.com/tpj/rules

						Andrew Dalke




More information about the Bio-soft mailing list