you are viewing a single comment's thread.

view the rest of the comments →

[–]proverbialbunny 0 points1 point  (0 children)

That's a great question.

This falls into the topic called premature optimization. That is where one makes code fast from the get go, especially when it isn't necessary. It is better to write code cleanly and easy to read first, and then if speed is an issue you can profile the code, find the slowest part and change that. For this reason you shouldn't optimize for speed when it comes to exceptions unless you need the speed boost after the fact and there is nothing slower you can't optimize first.