From: Martin DeMello Date: 2008-02-29T02:34:25+09:00 Subject: Re: Monkeypatching is Destroying Ruby On Thu, Feb 28, 2008 at 6:16 AM, Florian Gilcher wrote: > > But, because we are lazy, lazy ruby programmers, we love our > object.send syntax. So we implement a shorthand method. Another > example is Object.in?(), often seen as a shorthand for > some_collection.contains?(obj) (Im not sure, but this is called > 'grief', afaik). The first is nicer, the second is cleaner. Many vote > for the first - another Method in Object. Another well known Library > defines Object#should because they think of it to be nicer. By doing > this, we are slowly overloading the core-system. And? There's nothing wrong with "overloading the core system" if the end result is cleaner and more readable code. Personally, good ruby code is all about expressiveness and readability, not proper OO encapsulation and staying-out-of-the-core. The only real problem, as you note, is that of conflicting extensions to the same core classes, and care does need to be taken with that, but that's no reason to throw the baby out with the bathwater. One interesting thing to do is something I've seen in the Javascript world - libraries that come with an option to install themselves in core classes or stick to a namespace, so that you can either type MyLib.do_something(object), or turn the option on and then do object.do_something. martin