[Pdx-pm] Fwd: Genomics at OHSU

Austin Schutz tex at off.org
Mon Nov 28 14:24:08 PST 2005

On Mon, Nov 28, 2005 at 11:02:26AM -0800, Thomas J Keller wrote:
> Hi All,
> This is probably cheating. Tough, defending Perl against this Python  
> snob should get you riled up enough to burn up a few of those T-day  
> calories. So help me out here. Any other good arguments for this in  
> house discussion? The fellow I got into this with is an Assistant  
> Professor  in the Medical Informatics program. I'd like him to get  
> over his dislike for Perl.
> What occurs to me to say is that if you can't understand someone  
> else's perl code, they either didn't intend you to, or they were too  
> short-sighted to write it properly. And what I like about Perl is  
> that I can do anything with it that needs to be done. (I usually have  
> to ask some help from the highly vaunted perl mongers of course.)

	I would disagree with the statement regarding intent. Because Perl
is such a powerful and flexible language, it lends itself to the style of
programming most comfortable to the programmer. I've seen perl that looked like
everything from C to ksh to basic. One very competent Perl programmer I've
worked with made liberal use of perl formats, which are pretty bizarre at
first glance.

	if your key criteria are readability and ease of code
maintenance, perhaps Python might be better. Looking over the Python core
libraries, for example, they appear clean, consistent, readable, and concise.
Don't take my word for it, go look for yourself.
	You don't ever see statements like:

  return sort map {($_, db_complete($_ . "::", "V ", 2))}
    grep /^\Q$text/, map { /^(.*)::$/ ? ($1) : ()} keys %:: # top-packages
      if (substr $line, 0, $start) =~ /^\|*[Vm]\s+$/ and $text =~ /^\w*$/;

	Python has a generally simple syntax and fewer builtins and globals
than Perl, so there's much less rope to hang yourself with. This simplicity
has also made it possible to have a stable threads implementation well before
Perl, as well as a java based python interpreter.

	That doesn't mean it's not possible to create simple, maintainable perl
code, just that the language doesn't push you into it. There's definitely
more of a learning curve to create maintainable code, and more of a learning
curve to understanding it. I've seen bad python code to be sure, but it seems
more of a rarity and it's still been easier to follow than the equivalent badly
written perl.

	The other side of the coin is that the flexibility, expressiveness,
and power of Perl make development faster than in any other language I've yet
to work with, and the supporting libraries add much on all three counts. Our
team uses it every day, and we support far more applications per developer than
other development teams within our company. YMMV.


More information about the Pdx-pm-list mailing list