From: James Edward Gray II Date: 2010-01-05T12:21:34+09:00 Subject: [ruby-core:27411] Re: [Feature #1082] add Object#singleton_class method On Jan 4, 2010, at 8:41 PM, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: [ruby-core:27407] Re: [Feature #1082] add Object#singleton_class method" > on Tue, 5 Jan 2010 11:26:41 +0900, Shugo Maeda writes: > > |I prefer singleton_class than eigenclass. I suppose that "singleton > |class" is not so confusing with a class which implements the Singleton > |pattern because the word singleton remind Ruby users of singleton > |methods rather than the Singleton pattern. > > Basically, I agree. I know we worry a lot about people confusing the term, but I've just never met anyone who does. In all my time in Ruby, I haven't run across one single person who said to me, "Oh, you mean it's the Singleton Pattern?" Have others really seen more of this problem actually occurring? Even with the double meaning, I really don't feel like this is one of the more confusing concepts in programming. We have much worse. I personally have far more trouble teaching what a Symbol is in my classes, for example. :) If someone really does confuse it, we'll explain it and send them on their way armed with better knowledge. Finally, the damage is already done. For a long time, Ruby considered it a singleton class, for better or worse. We have core methods named after it, but are told we can't add a method because of the name. I think it's a little late for that now. Besides, if we change it people will just have a new problem, "Oh, didn't that use to be called the singleton class?" Those are my three reasons why I vote for singleton class. Matz, I know your patience exceeds mine 1,000 fold. That's one of your great strengths and why you are in charge. I totally trust you too. However, I don't think you're going to find the perfect name this time. You've waited a long time and heard a lot of choices. If nothing has won you over yet, maybe we should just go with an OK choice that we already have. Surely, seeing: obj.bad_name_class is preferable to: class << obj; self end and we can do even better than that with singleton_class. :) James Edward Gray II