Sticking a rescue at the end of a line may seem expedient, but it has a tendency to bite you when you least expect it. In today’s freebie episode, I demonstrate how dangerous an inline rescue can be, as well as showing a legitimate use for the construct.

httpv://youtube.com/watch?v=hTK7aV-YYnw

[boilerplate bypath=”rubytapas-sample”]

Published by Avdi Grimm

1 Comment

  1. […] Though this post was about the performance cost of using a ‘rescue’ statement, there is a more insidious problem with the overall impact of such syntax. The pros and cons of using a rescue are well laid out in Avdi’s free RubyTapas: Inline Rescue […]

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *