Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Coding styles: OOP vs. Subs

by dragonchild (Archbishop)
on Nov 17, 2005 at 16:11 UTC ( [id://509453]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Coding styles: OOP vs. Subs
in thread Coding styles: OOP vs. Subs

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?

Replies are listed 'Best First'.
Re^4: Coding styles: OOP vs. Subs
by Perl Mouse (Chaplain) on Nov 17, 2005 at 16:57 UTC
    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:>*
      That still seems like bad form to me. Imagine someone comes along and tries to extend it...
      use warnings; print ("$_")."blah" for qw /foo, #bar, BAZ/
      Just because you can do something doesn't mean you should. (Not that I'm implying that you should never turn off warnings. The OP's code isn't one of those times though).
        Huh? What's your point? Valid code throwing warnings prevents someone from introducing bugs?
        Perl --((8:>*

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-26 04:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found