develooper Front page | perl.perl5.porters | Postings from May 2008

Re: Should potentially confusing labels emit a warning?

Thread Previous | Thread Next
From:
Abigail
Date:
May 8, 2008 05:02
Subject:
Re: Should potentially confusing labels emit a warning?
Message ID:
20080508120204.GC7823@abigail.be
On Thu, May 08, 2008 at 12:41:19PM +0100, Spiros Denaxas wrote:
> On Thu, May 8, 2008 at 12:35 PM, Aristotle Pagaltzis <pagaltzis@gmx.de> wrote:
> >
> >  A Perl::Critic policy has been submitted for this, but it seems
> >  to me that this is a potential bug worthy of attention from the
> >  core. Now, I am hesitant on adding new warnings but I think in
> >  this case it really is worthwhile; it could, after all, be
> >  disabled easily enough. (What was the consensus on making
> >  `use warnings` mean something other than `use warnings 'all'`?)
> >
> >  Regards,
> >  --
> >  Aristotle Pagaltzis // <http://plasmasturm.org/>
> >
> 
> Hullo,
> 
> I agree that this can potentially save people a fair amount of time when trying
> to track down bugs in their code but I am somewhat hesitant of adding
> a new warning just for it. Could this potentially be integrated in the
> 'diagnostics'
> pragma and be explicitly printed only if the pragma is being used?


Me too.

Two points I like to say. First, a general point. IMO, such issues should
be addressed by a lint like program (for instance, Perl::Critic), and not
by 'use warnings'. As for this particular case, the number of people that
use 'BEGIN:', don't spot it quickly, and actually use 'use warnings' doesn't
strike me as high. Doesn't strike me as a worthwhile trade off.

OTOH, I doubt there will be much code that would trigger a false warning
if such a warning would be added. And any obfuscated code wouldn't use
warnings any way.


Abigail

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About