Re:Refinements in Ruby — Monkey patching for friendly monkeys
by generalk on Sunday November 28, 2010 @11:46AM
(#1947590)
I don't get it. What's bad about incentivizing monkey-patches that don't interfere with other code?
[ Parent
| on HN ]
Re:Refinements in Ruby — Monkey patching for friendly monkeys
by jonathanwallace on Sunday November 28, 2010 @12:39PM
(#1947692)
The only thing that comes to mind is its not immediately obvious when source diving when a piece of code has been refined or redefined.
IMO, this is the justified cost of flexibility provided by monkey-patching.
Re:Refinements in Ruby — Monkey patching for friendly monkeys
by jerf on Sunday November 28, 2010 @03:46PM
(#1948244)
This isn't specifically a problem with monkeypatching. Not knowing what is in scope right now is a generalized problem with object oriented programming. Scoped monkeypatches doesn't really add to the problem, IMHO.
(Please note I don't even mean that as a criticism of OO per se. Like everything else, it has costs and benefits, and that is, well, actually a bit of both. Things being hidden from you is annoying, but if you switch to something like Haskell you'll find that everything being shown isn't always entirely cool either.)