[Tutor] Regex's and "best practice"

Carl D Cravens raven at phoenyx.net
Sun Nov 23 21:13:22 EST 2003

On Sun, 23 Nov 2003, Daniel Ehrenberg wrote:

> There is a major difference in the philosophies of
> Perl and Python. Among other things, the Pearl doesn't
> have nearly as many standard libraries as Python does
> because they believe that things should be in
> seperate, user-made libraries, or just reimplimented
> in the individual program.

I really don't think I can agree with this.  The core Perl5 install comes
with a great number of modules.  cpan.org is overflowing with modules of
all kinds.

In looking at switching to Python for larger projects, one of my worries
has been a _lack_ of modules to draw on compared to Perl.

> With Python, unless you have a specific goal of creating a faster
> library or something (in which case you'd probably use C anyway), it
> really doesn't make sense to reimpliment things. The availability of
> these libraries should be taken into account when considering how easy
> it would be to make one of these programs. If there is no similar
> library in Perl, that doesn't mean you should write the Python program
> poorly.

My goal is to learn Python, not to create a solution to a problem.  The
program I chose to reproduce just happened to do something an existing
module already does.  If I used that module, I'd be defeating the purpose
of writing the program, which is to learn how to process text from a file
and see how it compares to what I already know in Perl.  If I let a module
do all the work for me, I do not learn what I set out to learn.

Carl D Cravens (raven at phoenyx.net)
Hey, I ran Windows the other day, and it didn't crash!

More information about the Tutor mailing list