Beefy Boxes and Bandwidth Generously Provided by pair Networks Ovid
more useful options
 
PerlMonks  

Re: Is it me?

by chas (Priest)
on Sep 14, 2005 at 14:22 UTC ( [id://491958]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Is it me?

If a script is developed (using strict and warnings), and is considered complete and working as expected, is there a reason to leave the use strict (or warnings) turned on? I suppose it doesn't hurt and could be useful for someone else who might edit the script, but other than the latter possibility, I'm really not sure.
chas

Replies are listed 'Best First'.
Re^2: Is it me?
by jacques (Priest) on Sep 14, 2005 at 14:24 UTC
    Well, in that case, you would want to keep them in there since programs are almost never "complete" including your own.
Re^2: Is it me?
by tcf03 (Deacon) on Sep 14, 2005 at 14:32 UTC
    I would leave them there as well, if for nothing else than the general sense of good Perl style they advocate.

    Ted
    --
    "That which we persist in doing becomes easier, not that the task itself has become easier, but that our ability to perform it has improved."
      --Ralph Waldo Emerson
Re^2: Is it me?
by perrin (Chancellor) on Sep 14, 2005 at 16:15 UTC
    Most of the time, you don't get 100% coverage when you test things. That means there might still be a situation where something unexpected goes wrong, and a useful warning helps you track down what it was.
Re^2: Is it me?
by exussum0 (Vicar) on Sep 15, 2005 at 11:30 UTC
    Leave it in. People forget to put it in, turn it on, flip the switch and diddle the nob. It doesn't really impact performance beyond negligible.

    Lord knows how many time I've forgotten nuances and rules of things to check when things break. When things aren't working right, make it obvious. Use strict.

    (paid for by the strict.pm party. strict.pm for prez, 2008!)

    ----
    Give me strength for today.. I will not talk it away.. Just for a moment..
    It will burn through the clouds.. and shine down on me.

Re^2: Is it me?
by QM (Parson) on Sep 15, 2005 at 14:54 UTC
    ...is there a reason to leave the use strict (or warnings) turned on?
    Flip that around -- why would you turn it off? If you can't justify turning it off, then it should stay on.

    Brainstorming here, possible reasons to turn strict and warnings off:

    Speed: Not performing all of those compile- and run-time checks is bound to improve speed. Only benchmarking will tell if it's a real gain or not.

    Confusing users with warning messages: If code spits out warning messages, it should be for a good reason, and it should be meaningful to the user. For example, if the file doesn't exist, that's something the user should understand. If the Beeblebrox is in Ratzafratza, then maybe the message should be changed to something like:

    The Beeblebrox is in Ratzafratza. This should never happen. Please contact the maintainer of this script.
    If your code sometimes innocuously spits out warnings that you know don't make any difference, for maintenance reasons you are better off to use no warnings around the offending statement, rather than turn off warnings everywhere.

    Laziness: OK, I'm not sure how this would apply.

    Hubris: Umm, I'm really not sure how this would apply.

    Any others?

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://491958]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.