Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

chromatic (983)

  (email not shown publicly)

Blog Information [] Profile for chr0matic []

Journal of chromatic (983)

Thursday August 07, 2008
05:19 PM

Did You Ask the Landlord?

[ #37125 ]

Among the features backported into 1.8.7 from Ruby 1.9 is a new #chars attribute. 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).

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • 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

    • 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.

    • I'd say there's nothing wrong with monkeying with classes you don't 'own'.

      ... until Daddy comes home, anyway.

      My amusement comes from the idea that Rails could have done the right thing (incidentally avoiding Primitive Obsession [] 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.

      I particularly liked the "It's the fau

  • No thanks. Are you trying to give squatting [] a bad name?
    • 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?

      • 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.