Re: Why aren't 'warnings' on by default?
From: Anno Siegel (anno4000_at_lublin.zrz.tu-berlin.de)
Date: 02/19/05
- Next message: Mike Dowling: "Re: cperl-mode and emacs-21.4 brocken?"
- Previous message: ioneabu_at_yahoo.com: "emacs AAAAAAAAAAAAAHHH!!!"
- In reply to: Tassilo v. Parseval: "Re: Why aren't 'warnings' on by default?"
- Next in thread: Abigail: "Re: Why aren't 'warnings' on by default?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 19 Feb 2005 14:11:24 GMT
Tassilo v. Parseval <tassilo.von.parseval@rwth-aachen.de> wrote in comp.lang.perl.misc:
> Also sprach Anno Siegel:
> > Tassilo v. Parseval <tassilo.von.parseval@rwth-aachen.de> wrote in
> comp.lang.perl.misc:
[unplanned warnings from a module]
> >> Does it mean there's a bug in the module,
> >
> > Yes. See below.
> >
> >> or maybe in my program using
> >> this module? Or maybe it's a potential bug that could occur under
> >> certain rare circumstances. It could just as easily mean nothing of that
> >> kind and only expose the module's author's sloppyness.
> >
> > If a module issues warnings the author didn't intend the user to see,
> > that's a bug. Most of the time it is trivially fixed.
>
> Ah, but there the warning itself becomes the bug. The trivial fix would
> be getting rid of 'use warnings' within the module. No warning, hence no
> bug. ;-)
Taking out "use warnings" doesn't fix the bug -- the user can make it
reappear through -w. You need "no warnings ..." in the right scope.
That scope would rarely be the entire module, but rather the smallest
possible scope that does the job. Or you change the logic so that
the warning doesn't happen in the first place.
> There is obviously something very contorted in this logic just outlined.
> But it is the direct implication of your assertion that a warning
> produced by a module is a bug.
It's less contorted when the fix is as outlined above.
> > If the module author has "use warnings" early in each file as a matter of
> > course, these problems are caught during development. Unfortunately, h2xs
> > issues a module template without warnings. That may be a reason why the
> > practice isn't more common.
>
> I just checked it (again). h2xs puts them in, unless a version older
> than 5.6 is specified using -b or --skip-warnings is mentioned
> explicitly.
You are right. Apparently it has done so since at least 5.6.1. I don't
know what made me think otherwise.
[...]
> >> If warnings in module context really and rightly suggest there's a bug,
> >> then the bug itself will sooner or later manifest in some other way,
> >> wont it? Otherwise it wouldn't be one.
> >
> > What about silently delivering wrong results?
>
> It's not at all clear to me how wrong results correlate with the amount
> of warnings emitted. I will admit that the likelihood of warnings is
> probably higher when a wrong result is being computed (and vice versa).
> However, there will still be many cases where those two things will be
> entirely uncorrelated. If anything, warnings from a module will give me
> doubts about the quality of the module in question.
The warning indicates a case the author hasn't thought of and hasn't
tested. If the results are correct in such cases that's coincidence.
> >> The point being that warnings
> >> rarely provide information useful to people not in charge of the code.
^^^
> >
> > Really? I'd understand "(not) useful to the people running the program",
> > but as a developer I'm just as interested in warnings as I am in errors.
>
> I see myself as a plain user when it comes to external modules and...
Sorry. I consistently overlooked a "not" in your sentence. My objection
makes no sense.
Anno
- Next message: Mike Dowling: "Re: cperl-mode and emacs-21.4 brocken?"
- Previous message: ioneabu_at_yahoo.com: "emacs AAAAAAAAAAAAAHHH!!!"
- In reply to: Tassilo v. Parseval: "Re: Why aren't 'warnings' on by default?"
- Next in thread: Abigail: "Re: Why aren't 'warnings' on by default?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|