Talk About Network



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 > C++ Question: t...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 9 Topic 905 of 979
Post > Topic >>

C++ Question: try-throw-catch

by Michael Hathcock <lord_mykhal@[EMAIL PROTECTED] > May 14, 2007 at 08:49 PM

Hi, all.

I am formerly a lurker here, but I have recently begun to get back into 
game programming after a 12 year break from the hobby.  My prior
experience 
with game programming is almost limited to the C language (I've done
little 
programming with QBASIC, Libery BASIC for Windows, C++, and a few other 
obscure languages.)

I have begun working on a role-playing game using C++ for Windows with 
DirectX support (later adding support for OpenGL.)  As I design the game/ 
engine on paper, I found myself wondering, "What are all the con's to
using 
the C++ try-throw-catch syntax for handling program errors?"

In the early versions of C++, this system used by C++ was said to be 
horrible due to code-bloat and a performance hit (in terms of speed.)  In
C 
errors are handled by using return values and countless return value 
checks.

Since it has been some time since I have worked at programming, has the
C++ 
syntax improved (less code-bloat, better performance) or will it be better

to use return values as is the system used in C?  The engine that I am 
designing is currently using the try-throw-catch syntax and a custom 
exception class that I wrote.  In the long run, will this syntax choke the

game engine or will the extra support code C++ uses (the extra code to 
handle function calls, stack unwinding) to implement the syntax have 
minimal impact?

- Michael Hathcock




 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 Thu May 15 18:47:27 CDT 2008.