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 9 of 9 Topic 905 of 1011
Post > Topic >>

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

by ajk <ak@[EMAIL PROTECTED] > Jun 27, 2007 at 12:14 AM

On Tue, 26 Jun 2007 03:20:14 -0000, "Brandon J. Van Every"
<bvanevery@[EMAIL PROTECTED]
> wrote:

>On Jun 25, 10:55 pm, Miss Elaine Eos <M...@[EMAIL PROTECTED]
>
>wrote:
>> In article <1182825713.122029.269...@[EMAIL PROTECTED]
>,
>>  "Brandon J. Van Every" <bvanev...@[EMAIL PROTECTED]
> wrote:
>>
>> > 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.
>>
>> Oh, sure -- I wasn't arguing that point.  I was only pointing out that
>> the world is neither black nor white -- there are situations in which
>> try-catch is appropriate, those where throwing the error up is
>> appropriate and those where error-logging/cra****ng are appropriate.
>>
>> I only meant to point out that it's just as bad to always use one
>> technique as to never use it -- "the right tool for the right job" and
>> all that.
>
>I'm specifically talking about prototyping though.  Unless some
>****tion of your prototype is well trodden ground, and you've
>implemented error handling policies dozens of times in the past for
>pretty much exactly the same problem, you're dealing with a lot of
>design instability.  My view is that when prototyping, you should be
>banging out your design *quickly*.  And it's going to change a lot.
>You could be doing throwaway prototyping, where your code won't even
>exist a month or two from now.  Or you could be doing evolutionary
>prototyping, where your code will have mutated in im****tant respects
>from what you started with.
>
>In my view this is just a specific instance of the "You Ain't Gonna
>Need It" programming philosophy (YAGNI). 
http://en.wikipedia.org/wiki/You_Ain't_Gonna_Need_It
>I've overengineered a lot of systems in the past, and sweated an awful
>lot about error handling protocols, only to see it prove irrelevant in
>the real world of code change.  My view is that worrying about C++
>exception handling merely slows down development in the early stages
>of design.  I say skip it.  In fact, skip any kind of error return at
>all.  It's very likely that You Ain't Gonna Need It.
>
>You definitely need to issue warnings, generate logs, and do***ent the
>various ways your code can fry, however.  Even when prototyping.  It's
>usually pretty easy to write out some string that says, "This code
>just fried this way."  It's a form of commentary, and it does
>something useful during debugging.
>
>
>Cheers,
>Brandon Van Every

my experience is that try-catch are quite ok to avoid some nasty popup
to user about unhandled exception.. that is about it. designing a
program that intelligently recovers from errors using try/catch is
just too complicated. it is better just to log if an error occurs and
then log so close to where it happened as possible.

my 0.02
ajk
 




 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:08:13 CDT 2008.