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

Re: Best practices for handling errors

by eyepopslikeamosquito (Archbishop)
on Sep 27, 2014 at 22:33 UTC ( [id://1102243]=note: print w/replies, xml ) Need Help??


in reply to Best practices for handling errors

From essential practice number eight in Conway's Ten Essential Development Practices, "Throw Exceptions Instead of Returning Special Values or Setting Flags" (also covered in Perl Best Practices, Chapter 13, Error Handling):

The bottom line: regardless of the programmer's (lack of) intention, an error indicator is being ignored. That's not good programming.

Though you may not agree with all Conway's arguments, as indicated at Two Different Languages: Two Similar Books (PBP and CCS) (in the "Some Similar Guidelines Found in Both Books" section), throwing exceptions rather than returning flags seems to have become mainstream error handling advice nowadays.

Update: All 255 Perl Best Practices listed here: Perl Best Practices Summary

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-23 03:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found