develooper Front page | perl.perl6.language.strict | Postings from February 2001

Re: Warnings, strict, and CPAN

February 16, 2001 18:36
Re: Warnings, strict, and CPAN
Message ID:
On Fri, Feb 16, 2001 at 06:08:20PM -0800, Peter Scott wrote:
> >Come to think of it, what language or popular compiler does have
> >run-time (not compile-time) warnings on by default?
> Er, Perl is loose enough that those run-time warnings substitute for only a 
> part of the kind of strictness checking that other languages do at compile 
> time.

Not quite the point.  I'm looking for an analogous situation so we can
use the result as something of a case-study.

> But if you want P6 to be so backwards 
> compatible that the largest issues are smaller than "@", an awful lot of 
> good stuff ain't gonna make it in, it seems to me.  'Sides, we already got 
> some clues that P6 won't have to be that backwards compatible with P5.

Perl 6 is going to break things, fine.  But break them for a better
reason than saving a few keystrokes, please.

> I repeatedly tell people, "If you're handed a program that doesn't have 
> -w/use strict in it, hand it back and say, Please insert -w/use strict, and 
> give it back to  me when you've eliminated all the resulting messages," and 
> many of those people have thanked me for that instruction.  So far, 
> no-one's said it was a bad idea.

That's fine if people know why.  Some people don't.  Some people know
why and decide otherwise.  Complicate it by the fact that its no
longer a human rejecting your perfectly valid code, but a computer.
People will resent it.

You also have to take into account the legions of sysadmins who use
Perl as more powerful shell scripting.  Do not equate not using strict
and warnings with "newbie".

> I don't get this.  If someone's developing code right now with "use 
> warnings", and they want to ship with warnings disabled, they gotta edit 
> the code anyway.

They're not using the warnings pragma, they're mostly using -w when
its run and tested.  Alternatively, you can set PERL5OPT='-w' on your
development machines (though I haven't heard of this in wide

Code style is a very, very emotional and personal issue.  Adding any
default enforcement is going to piss off lots and lots of people.
Just look at how much discussion this topic has generated all over the
lists!  What's the net gain?  Some vague ideas about making people
more aware of warnings and saving a few keystrokes.

Instead, let's concentrate on some more tangible areas of need.  Perl
is almost completely lacking in code metric tools.  We have no
statistical analysis tools, our coverage library is barely there and
our two profiling tools are anemic and underdocumented.  Our lint
checker is an early alpha.  CPAN has no security checks, no author
signatures, little auditing.  Vast sections of perl's core libraries
and source code are not covered by tests, etc... Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About