[LRUG] [Chat] IronRuby

Martin Sadler mtsbtt at googlemail.com
Tue Jul 24 07:42:53 PDT 2007


I'm with you on this too.

I use exceptions sparingly. Littering your app throwing exceptions
left right and centre is definitely a recipe for disaster.

My point was to what extent would IronRuby currently penalize you
performance wise for exception handling on a typical Rails app.

As it happens it seems not much.

On 24 Jul 2007, at 13:45, Tom Ward wrote:

> On 24/07/07, David Salgado <david at digitalronin.com> wrote:
>> Personally, no. I'm just against exceptions occurring as an  
>> integral part of
>> the core of your application. Catching a save! exception is great for
>> errors, but you shouldn't be throwing exceptions unless something  
>> goes
>> wrong.
>
> I agree with this.  And by something going wrong, I would mean more
> than just a validation failure in a place you might expect validations
> to fail.  So to me, this pattern (which I've seen in the wild) or
> variations of the same would smell bad:
>
> def create
>   @person = Person.new(params[:person])
>   @person.save!
>   redirect_to :index
> rescue
>   # validation failed, go back to form
>   redirect_to :new
> end
>
> If you go along with this, then the performance of begin/throw/rescue
> in IronRuby shouldn't make much difference to the core performance of
> your app.
>
> Tom
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org




More information about the Chat mailing list