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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
In case it is obvious, the claim that error handling is something that you do appropriately to the task is one that I disagree with. There is virtually no script that I write that doesn't have error handling somewhere. Whether 5 lines or 5000 I have it in.

That said, I think we all have seen elaborate and stupid error handling. Error handling - like everythingthing else in programming - is not an ideal good in and of itself. It serves a goal. That goal is that if your program does not do what you want, that it will let you know that with enough useful information that you can fix the problem. If you are reporting non-errors, or failing to report real ones, or failing to be useful - all are bad.

It is important because code is inherently buggy. A claim that I have heard is that there is an average of one bug per 10 lines written. Dunno if that is true. (I always suspect claims with conveniently round numbers in them.) But certainly the real number is very high. Your error handling is not where you want those bugs to be. Therefore you make your scheme very simple, and concentrate on real errors.

One of which, I guarantee you, is going to be the failure to open a file you expected to be able to open...


In reply to Re (tilly) 9: out of loop by tilly
in thread out of loop by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found