Among the features backported into 1.8.7 from Ruby 1.9 is a new
#charsattribute. Unfortunately, it is incompatible with the Rails 2.0 implementation of#chars.
Avdi Grimm, The Trifecta of FAIL
It's a bad idea to remodel a house you don't own. Maybe the word "monkeysquatting" is more descriptive (if not more visceral).
That one's been waiting to happen for a while (Score:1)
Speaking as one who has added methods to UNIVERSAL and, on at least one occasion, set @UNIVERSAL::ISA, I'd say there's nothing wrong with monkeying with classes you don't 'own'. What always gave me the heeby jeebies about the way Rails does it is that they chose names that were obvious hostages to fortune.
When I was hacking on Pixie and needed to add methods to UNIVERSAL, everything that went in got a px_ prefix and should probably have had a pixie_ one. (Actually, now I think about it, we used to take adva
Re: (Score:1)
Yes, the algorithm for choosing a safe name is, ah, less than wonderful. Should at probably be SHA1('pixie:pickle'), assuming we don't mind outsiders being able to guess the opaque method's name.
Re: (Score:1)
... until Daddy comes home, anyway.
My amusement comes from the idea that Rails could have done the right thing (incidentally avoiding Primitive Obsession [jamesshore.com] as well as monkeysquatting) by using its own String subclass. It's opinionated software. You use its own APIs throughout your system. This is cheap insurance -- and think how easy it would be to fix HTML escaping in one place, for all time.
New monkey-squatting name? (Score:1)
Re: (Score:1)
Is there a better term to describe pretending to own a namespace and getting in trouble when your ideas of ownership conflict with that of the real owners?
Re: (Score:1)
I like squatting as a name.
It is more self-explanatory than monkey-patching,
which name apparently is indirectly derived from guerrilla-
patching, through gorilla-patching.
I wonder if that's true or not.