python vs perl lines of code

Edward Elliott nobody at 127.0.0.1
Fri May 19 23:29:49 EDT 2006


John Bokma wrote:

> Edward Elliott <nobody at 127.0.0.1> wrote:
> 
>>>> like "from X import *" which are generally frowned on in python while
>>>> 'use MOD qw(id)' is encouraged in perl.
>>> 
>>> Not by me, and I doubt it is in general.
>> 
>> Well it's all over the Perl Cookbook.
> 
> Yeah, sure, all over. 

125 occurences in 78 recipes.  Sure looks like all over to me.

> Maybe check the book again. It is used in some 
> examples, sure. And it even explains how it works. 

Yep, 125 times.  In 78 recipes.  Out of 105 total recipes with 'use'.  I'd
say a 3:1 ratio is pretty strong encouragement.

> Don't forget that most 
> of the book was written around 1998. Yes, 8 years ago.

Doesn't matter.  It's still the standard example reference.  People use it
heavily.  They don't magically know what parts are now deprecated.
 
> You can even find examples on my site that use imported functions (which I
> will fix, because I frown upon it :-) ). But I doubt you can find a
> majority in the perl community that *encourages* the use of imported
> functionality.

I can readily believe that the "community" frequenting the newsgroups,
mailing lists, and blogs don't encourage it anymore.  But that's a tiny
fraction of all perl programmers, and most of them have no exposure to this
little clique.  For many people, whatever the cookbook says goes.  If it's
wrong, update it.

-- 
Edward Elliott
UC Berkeley School of Law (Boalt Hall)
complangpython at eddeye dot net



More information about the Python-list mailing list