Hi --

On 3/14/07, Giles Bowkett <gilesb / gmail.com> wrote:
> I just solved a problem by adding an instance method to String.
>
> It makes for very elegant code elsewhere within the application.
>
> Yet I can't shake the feeling I've done something dirty.
>
> I think there needs to be a group like "Recovering Java Programmers
> Anonymous" or somehting.

Feeling squeamish about changing the core language isn't the sole
prerogative of recovering Java programmers :-)  There's still no good
answer to the question of how to do it safely and in a way that does
not risk conflicts, though there are various "better practices".  My
favorite is "extend", which lets you confine changes to particular
objects.  That's not always very efficient, though.


David

-- 
Q. What is THE Ruby book for Rails developers?
A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black)
   (See what readers are saying!  http://www.rubypal.com/r4rrevs.pdf)
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?
A. Ruby Power and Light, LLC (http://www.rubypal.com)