On Wed, Sep 13, 2000 at 11:20:46PM -0700, Nathan Wiger wrote:

[snippity-snip]

> I just think it's a case of "crying wolf", especially when other
> people's CPAN modules start spewing this stuff out from perfectly
> reasonable code, filling up your web error logs with "uninitialized this
> and that". As a sysadmin, that pisses me off. :-(
> 
> Perhaps I should post to p5p about splitting up uninitialized warnings
> into numeric and string contexts. Then at least I could get rid of all
> the annoying strings ones and keep the number ones around. But the
> problem of other people's CPAN modules is still a biggie...


Much of your problem has been solved through lexical warnings.  If you don't
want uninitialized warnings you say:

    no warnings 'uninitialized';

and it's assumed you know what you're doing.  If a module wants the same, it
can do the same, and the change is restricted to just that module;
similarly, if you want warnings, and an external module doesn't, it
shouldn't have them forced upon it.  If a module spits out warnings at some
later date from perfectly fine usage then it's a bug with the module that
should be reported and fixed.

Defaulting to not spitting out uninitialized warning errors, IMHO, is a bad
idea.  If a programmer is going to be lazy about checking then that
programmer should explicitly disable the setting; if it has a default of
being turned off most people will simply leave it off, which will make bugs
that much harder to track down.

I can see the counter-argument: "well, use warnings and use strict is
optional, why not add one more pragma?".  The fact that use warnings and use
strict being optional bites newbies, as has been mentioned.  There are
various arguments for and against, and I don't really care which way it
goes, so long as I get strict and warnings; I don't, however, want to have
to keep adding pragmas because various people are annoyed by a given warning
or error.

I say if the programmer is asking for warnings, give him warnings; if he
wants fewer warnings, he has to say so.


Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

Reply via email to