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


|