On 1 Jul 2009, at 12:31, Robert Klemme wrote:
> I couldn't have put it better than Ellie.  Notice that object
> allocation is one of the most expensive operations in Ruby.  So it may
> pay off to save one.  Btw, this is also the reason why my solution
> only works with Fixnums.
>
> Apart from that I find unnecessary object creation ugly.  You may call
> that personal taste but with GC in mind there is also a quantifiable
> reason to not waste objects.

I share that view. Being promiscuous with resources just because it's  
simple to do so seems like a sure-fire way to build applications with  
intrinsic scalability problems. It may save me some effort today, but  
experience taught me long ago that it's a decision that will come back  
to haunt me.


Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-brains.net
----
raise ArgumentError unless @reality.responds_to? :reason