------art_11036_27409028.1203952079154
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Sun, Feb 24, 2008 at 11:33 PM, Marc Heiler <shevegen / linuxmail.org>
wrote:

> > I think the point of this blog was to discourage people
> > from using it because it is dangerous.  There are simple alternatives.
>
> Why is it dangerous?


It is equivalent to modifying global variables.  Modifying globally
accessible classes (not just meta-classes) should be exception, not the
rule.

matz also agrees that monkey patching is dangerous.  Here are a few quotes:

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/172172

"open class" is so strong (often too strong), we can break things easily. In
other word, Ruby trust you to give you sharp knives, where Python don't.
From the Python point of view, it's wrong, I guess.

http://www.rubyist.net/~matz/slides/rc2005/mgp00031.html

   - Open class is Too Dangerous
      - Global Modification

Until there is a "safe" way (i.e. namespaces) for monkey patching (opening
global classes), I think it should be discouraged.  Discouraged, not
banned.  It still is a tool that can be used, but it shouldn't be the first.

------art_11036_27409028.1203952079154--