Advertisement

exceptions, anyone?

Started by March 03, 2000 03:51 PM
2 comments, last by Ridcully 24 years, 8 months ago
i was wondering if anyone uses c++''s exceptions. can they be used to substitute returning an error value? anyhow, would it make any sense to implement them? thanks for opinions ridcully
Yeah, i use exceptions in my game engine. read this doc on them:
http://www.cubonics.com/graphics/docExceptionHandling.html

it explains how to use it. it really cuts down on unnecesary error checking.


_________________Gecko___
Gecko Design

_________________Gecko___Gecko Design
Advertisement
I use exceptions mostly only for runtime errors in interpreting scripting languages. Otherwise I find that normal return values are good enough.
I use exceptions for about 99% of my code. The last percent is for really high speed code since exceptions are very slow. An example of this is my texture cache. If there is an error and a texture cannot be loaded then I return a error that says to use a default texture. If You throw an exception there the frame rate would go down to about 1 or 2 fps.

The benefits of exceptions far outweighs their speed hit as long as you recognize where using them would be a problem.

This topic is closed to new replies.

Advertisement