Error Checking versus Speed

Started by
12 comments, last by Genjix 19 years, 10 months ago
Correct me if I''m wrong but I get the feeling you''re just too lazy to do error checking and need a good excuse not to.
Which is understandable because error checking can be a pain, especially since it doesn''t contribute to the ''coolness'' of your game.
Well if your a hobby programmer:
If you can get yoourself to do it, do it, there are only advantages. Otherwise well just tell the users what hardware they need and hope all goes well in the game.

If you are professional:
Get to work and do those error checking routines.
-CProgrammer
Advertisement
Error checking is good.

Premature optimization is usually just a waste of time. Especially if I read threads that say that using a for() loop with ++i is faster than i++ because it doesn''t allocate the counter on the stack. If that code is in your init functions, who cares.

Once you find a speed bottleneck with profiling in the finished project, you can consider removing some error checks that never fire, if it helps. Just leave the rest in, a messagebox that says error is better than a Dr.Watson or an exception that terminates your program.
If you are using Managed (.NET) then try and catch should not take away very much speed until an exception is fired.
quote:Original post by Genjix
?Suggestions?

Elaboration.

This topic is closed to new replies.

Advertisement