Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Coding styles: OOP vs. Subs

by SolidState (Scribe)
on Nov 17, 2005 at 06:42 UTC ( #509307=note: print w/replies, xml ) Need Help??

in reply to Coding styles: OOP vs. Subs

Hi nikos,
You think you have it bad? One guy at my workplace refuses to "use warnings;" because, get this, they generate warnings, and he doesn't want to deal with them!
In other words, he's convinced that as long as he doesn't see the warnings everything is fine...

Replies are listed 'Best First'.
Re^2: Coding styles: OOP vs. Subs
by Perl Mouse (Chaplain) on Nov 17, 2005 at 09:42 UTC
    Or, everything is fine, and the warnings are wrong. Note that warnings are generated when Perl thinks the programmer made a mistake - if Perl would be sure, it would have thrown an error.

    I've removed 'use warnings' from programs as well, after getting tired of adding 'no warnings' all over.

    Perl --((8:>*
      I'm surprised; "use warnings" saved my a** a couple of times, and the overhead is really small :
      $ wc -l *.p* | tail -n 1 6949 total $ grep "no warnings" *.pl | wc -l 8
      I'd be interested in seeing what kinds of programs those are. Other than throwaways, I have very rarely run into problems with warnings. The most common warning I see is "undefined value used in ...", which is alerting me to a real bug. Sometimes, I think I should turn the undefined warning into a fatal error, but I'm too lazy to do it. :-)

      My criteria for good software:
      1. Does it work?
      2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
        Here's a one-liner where Perl emits two warnings - both wrong.
        $ perl -le 'use warnings; print ("$_") for qw /foo, #bar/' print (...) interpreted as function at -e line 1. Possible attempt to separate words with commas at -e line 1.
        And yes, I know what the warnings are for. And I know how to code around them. The warnings are still wrong though.
        Perl --((8:>*

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://509307]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2023-03-28 18:04 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (68 votes). Check out past polls.