I'd give up Perl tomorrow if only...

David Mitchell djmitchell at NOSPAM.optushome.com.au
Fri Jun 21 06:48:43 EDT 2002

On Fri, 21 Jun 2002 20:03:16 +1000, Gerhard Häring wrote:

> I think the main point of CPAN is the automagical installation, that
> pythonsiphon tries to bring to Python.

That's right.  
> As for a searchable database, there's the Vaults of Parnassus, and the
> Python modules category at dmoz.org/directory.google.com/you.name.it.

I hadn't heard of pythonsiphon, but I'm pretty familiar
with the Vaults of Parnassus.  My chief concern isn't with the *quality* of
what's availabile in Python (and some of what's at CPAN is pretty grim in
this respect); it's the sheer *breadth* of what's at CPAN that makes it
so useful.

>> For just about any library module I've ever wanted, I can download one
>> or more modules from CPAN that gets me 90% of the way there.  Perl
>> modules like DBI/DBD, SOAP::Lite, GD::Graph, MQSeries::*, Tie::*,
>> Convert::EBCDIC,
> No idea what Tie::* is, but EBCDIC sounds easy to implement, should it
> not exist already, I haven't heard of an MQSeries binding for Python,
> but I've personally used Python libraries for the first three items, and
> they worked well.

ASCII<->EBCDIC conversion is pretty easy to implement in just about any
language, but it's also easy to make a typo somewhere when you're typing in
lots and lots of ASCII codes.  I know; I've done it ;->

The advantage of the pre-existing Perl module is that someone's already
written it, and 500 others have probably beaten out the bugs; there's a
degree of confidence there that I wouldn't have for some time if I was
typing in my own solution from scratch.  Not that I couldn't do it; just
that it'd take some time for all my typos to be sorted out.

>> If there was only some way to subclass Perl/CPAN modules as Python
>> modules
> PyPerl exists. That's all I can say to that (never used it myself), as
> my brain is incompatible with Perl.

PyPerl looks very interesting - hadn't heard of that either!  Glad I
posted the original message, and thanks to everyone who's responded for
some really useful ideas.  Reading through various newsgroup postings
on PyPerl courtesy of Google, it looks pretty robust as well, once you
get used to how it works.

For me, Perl has one big advantage over *every* other language.  If I have
to write a one-off piece of code to do some relatively simple task, and I
know that I'll truly never look at that code again, I can rip out a solution
in Perl almost as fast as I can think.  The problem is that that code
will be completely illegible to anyone else, including myself a few weeks
later, but as long as the job gets done and I don't have to worry about
it later, who cares what the code looks like?  I suspect lots of
experienced Perl coders will nod their heads as they read this...

Using Python, that same task will take me a bit longer (although
nothing like it'd take using, say, C or Java), but the code will be
relatively easy to go back to at some later date.  It'll be better
structured; the variables will have better names, and so on.

However, when speed of development is absolutely crucial, Perl can't be
beat.  (Thinks to himself: "Please don't let this turn into yet another
Perl vs. Python advocacy thread")

Dave Mitchell

More information about the Python-list mailing list