On Jun 25, 10:40 am, Miss Elaine Eos <M...@[EMAIL PROTECTED]
>
wrote:
> In article <1182747801.427938.107...@[EMAIL PROTECTED]
>,
> "Brandon J. Van Every" <bvanev...@[EMAIL PROTECTED]
> wrote:
>
> > Debug logs are
> > useful, but passing errors up the call chain isn't. Most of the time
> > it's a verbose way of saying, "I have no idea what to do, please crash
> > me."
>
> Often, it's a way of saying "it's not appropriate for me to decide what
> to do, I'll let the caller handle it.
>
> IO routines do this, commonly. It's rarely appropriate for an IO
> routine to decide how to handle an exception, and "please crash" is
> almost never what you ultimately want to have happen.
I'll reiterate the point in case it's not clear. You're prototyping.
You don't know how you're going to handle your exceptions. You pass
the buck to the caller, because as you said, it's not appropriate for
the function to handle the exception. Nor is it appropriate to
deliberately crash.
But in the real world, you aren't actually going to implement anything
to handle the exception. You're prototyping, the code is changing,
you don't have the time and it's not worth it. So the exception goes
to the topmost scope and just crashes. The point is, don't pretend
you're going to handle the exceptions during prototyping.
Warnings and error logs are a better drill. You've noticed the
possibility of an error, so record it locally. When your code
crashes, you know something about what happened.
Cheers,
Brandon Van Every


|