From: Eric Mahurin Date: 2008-02-25T02:13:33+09:00 Subject: Re: Monkeypatching is Destroying Ruby ------=_Part_6645_29714366.1203873220675 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sun, Feb 24, 2008 at 4:46 AM, Robert Dober wrote: > On Sat, Feb 23, 2008 at 10:07 PM, Avdi Grimm wrote: > > http://avdi.org/devblog/?p=18 > > Lots of people seem to confuse Runtime class modification > (metaprogramming) with MP. > There are very important issues to be discussed about if MP is on core > classes or commonly used packages > and most importantly if you MP in a package or in an application. > > I have the feeling that you were making *very valid* points but they > do not concern MP in at least 50% of their use cases. > (or maybe those I use). > This blog is really only an attack on the popularity of "monkey patching" (the python definition - patching existing classes/methods), not all of meta-programming: http://en.wikipedia.org/wiki/Monkey_patch If done with care the other aspects of meta-programming don't prevent portable/reusable/inter-operable code: * modifying methods of a specific object (unless it is a "global") at run-time. * evaling a piece of dynamically generated code. * defining classes on the fly (class factory) * introspection * etc. In my opinion, people should think about monkey-patching like they do global variables. Monkey-patching should be discouraged like global variables are. ------=_Part_6645_29714366.1203873220675--