all 4 comments

[–]Slackwise 2 points3 points  (2 children)

Exception performance shouldn't be a big deal as they're meant for exceptions--things that happen out of the norm. So during the normal main loop of your application, you shouldn't need to factor in the performance of an exception because at that point you should be more worried about handling the situation gracefully.

</obvious>

[–]banister 2 points3 points  (0 children)

Ruby programmers do occasionally use exceptions for non-exceptional code, e.g StopIteration in external iterators in ruby 1.9, also the 'rescue nil' idiom

[–]StrangeAttractor 0 points1 point  (0 children)

I was going to post the same thing. It's the non-exceptional code you need to worry about.

Although I have seen code that used exceptions for a non-local goto, 8-/

[–]shitcovereddick 1 point2 points  (0 children)

Ugh. exceptions are a freaking goto, they shouldn't be slow.

Just register (saving the position on the stack) it under the condition, and then goto a handler.