develooper Front page | perl.perl5.porters | Postings from December 2007

Re: 5.11 (or 12) and strict

Thread Previous | Thread Next
Michael G Schwern
December 27, 2007 20:17
Re: 5.11 (or 12) and strict
Message ID:
Abigail wrote:
> On Thu, Dec 27, 2007 at 07:42:11PM +0100, Aristotle Pagaltzis wrote:
>> * Sean O'Rourke <> [2007-12-27 17:45]:
>>> Do you have any evidence of this "large majority"?
>> FWIW, I just finished grepping all the Perl code installed on my
>> machine (ie. all the Perl code in my system that I didn???t write)
>> and I find that 5 in 7 files enable strictures.
>> If I had the patience, I???d grep my minicpan, but I haven???t got
>> that in readily untarred form so it???d take good day or so to
>> finish. But 5 in 7 sounds like a good lower-bound estimate for
>> how things are looking on CPAN as well, from my experience with
>> browsing source there.
> Neither the Perl code that comes with the tarball, nor CPAN is in 
> anyway a sample of 'typical' code that is out there.
> The vast majority of code written will never be publicly be distributed.

Then we can't measure it now can we?  We can only make up stories.  And some
measurement is better than no measurement at all.

Here's how my own site_perl turns out.  I've chosen site_perl because the core
modules are their own special level of cruftiness.

$ find . -name '*.pm' | xargs grep -l "use strict" | wc -l
$ find . -name '*.pm' | xargs grep -L "use strict" | wc -l

So that's something over 90% of all my installed .pm files use strict.

If someone wanted to get some more data points you might be able to cleverly
employ Google Code search, run through an operating system distribution
(Debian, FreeBSD, fink...) or SourceForge, FreshMeat and Google's repositories.

Something to keep in mind when doing these searches is the age of the code in
question.  There's a lot of really old perl out there.  The Perl community,
and indeed the entire dynamic language community, has matured rapidly in the
last five years, and older code is likely to show degraded practices.  Looking
only at recent projects would give a better idea.

But there's only so far you want to guide language design by widespread
practice.  That way Windows lies.  The customer is often wrong when it comes
to directing design.

We do what we must because we can.
For the good of all of us,
Except the ones who are dead.
    -- Jonathan Coulton, "Still Alive"

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About