note
monarch
The question made sense.
<p><code>die</code>ing is the right response when something occurs in code that the programmer was not expecting or hasn't got around to handling.
<p>On the other hand, as [graff] points out, when an error condition can be anticipated then testing for that error and producing an alternative response is a great thing to do.
<p>For example, in a commercial web app, it is conceivable that a database handle may not be obtained (high load, some tweap in operations decided to take the db offline, sunspot interference). What to do in the situation.. die and leave the user hanging? No; probably a more adequate response is a "website is busy, please return back soon!". If the webpage just <code>die</code>d then it would be particularly unpretty and unprofessional.
<p>Of course, if that multiline <code>if..elsif..elsif..</code> statement falls through to a final <code>else</code> that should be impossible, then <code>die</code> and <code>die</code> spectacularly.. the programmer needs to urgently tend to the impossible!
491423
491430