From: Trans Date: 2007-03-06T02:35:01+09:00 Subject: Re: object_* and instance_* methods On Mar 1, 6:53 am, dbl...@wobblini.net wrote: > Hi -- > > On Thu, 1 Mar 2007, Daniel DeLorme wrote: > > dbl...@wobblini.net wrote: > >> Why object_method? > > > 1. consistence: it's a meta-programming method > > They're all just methods, though. I'm uneasy with assigning clusters > of methods to super-categories. I think the results are better in the > end if choices are made at a more granular level: find the best name > for exactly what a given method is purporting to do. Clustering is > itself a "meta"-thing. Yet the methods we're talking about in particular are rather "meta"- things. Naming convention are very powerful b/c they ease the burden on the human mind , simplifying complexities, thus easing learning and allowing for higher abstraction. Case in point I was recently asked to add Module#instance_method? to Facets. My immediately thought was, "great idea", since I instantly knew what was being asked by the name of it. Only thing is, when I went to implement it, I realized we already had it --it would just be an alias for #method_defined?. method_defined? is an okay name for this functionality, but instance_method? is better because it conforms to a recognizable pattern along with #instance_method and #instance_methods. This may not seem like much, but many small things can quickly add up. I think Richard Feynman said it best, "never underestimate the power of notation", or something like that. T.