Quote:Original post by C0D1F1EDI'm afraid neither of that is quite true. Exceptions are a means to recover from errors in a graceful manner without killing the process. Killing the process or shutting down a module is not error handling, it is failure.
Exceptions are for things that really haven't been anticipated. Stuff that is reason for shutting down the entire application or at least a module. Especially in game development the performance hit for frequent exception throwing is unacceptable.
If you use exceptions only to kill the process, you can as well use assert(), it has easier syntax, and less overhead (but again, this is failure, not error handling).
The performance hit for exceptions is not at all unacceptable, unless you throw maybe 20,000 times per second. While it is true that exceptions are relatively expensive, they also are exceptional, they don't occur that often.
Even a hundred exceptions per second are not noticeable at all, and your code likely won't throw that many (or you have other problems!).