Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Gaming > Development Programming Misc > Re: C++ Questio...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 9 Topic 905 of 1011
Post > Topic >>

Re: C++ Question: try-throw-catch

by "Brandon J. Van Every" <bvanevery@[EMAIL PROTECTED] > Jun 26, 2007 at 02:41 AM

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
 




 9 Posts in Topic:
C++ Question: try-throw-catch
Michael Hathcock <lord  2007-05-14 20:49:21 
Re: C++ Question: try-throw-catch
ajk <foo@[EMAIL PROTEC  2007-05-15 11:29:37 
Re: C++ Question: try-throw-catch
Tom Plunket <gamedev@[  2007-05-24 16:18:56 
Re: C++ Question: try-throw-catch
"Brandon J. Van Ever  2007-06-25 05:03:21 
Re: C++ Question: try-throw-catch
Miss Elaine Eos <Misc@  2007-06-25 07:40:24 
Re: C++ Question: try-throw-catch
"Brandon J. Van Ever  2007-06-26 02:41:53 
Re: C++ Question: try-throw-catch
Miss Elaine Eos <Misc@  2007-06-25 19:55:06 
Re: C++ Question: try-throw-catch
"Brandon J. Van Ever  2007-06-26 03:20:14 
Re: C++ Question: try-throw-catch
ajk <ak@[EMAIL PROTECT  2007-06-27 00:14:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 2:13:01 CDT 2008.