From: Alexey Muranov Date: 2011-11-13T19:52:19+09:00 Subject: [ruby-core:40980] [ruby-trunk - Feature #5555] rename #include? to #includes? Issue #5555 has been updated by Alexey Muranov. Andrew Grimm wrote: > The spelling chosen was deliberate, according to this 2001 email http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/18951 > > > > "responds_to?" probably makes more sense to English speakers than > > > "respond_to?". > > > > Maybe. But I'm Japanese. Ruby is not English. It's the basic naming > > rule to avoid third person singular form in the standard libraries. > > > > you = Human.new > > if you.respond_to?(:knock) > > ... > > end > > > > buddies = member.collect{|x| x.friend_of?(me)} > > buddies.respond_to?(:select) > > Such spelling also exists for many other methods, such as String#start_with? > > If the spelling of include? were to be aliased, I'd recommend aliasing the spelling of all such methods, such as start_with? . > Failing to do so would be a far greater inconsistency than include? versus has_key? Good explanation. The method names can also me viewed as #(does_it_)include? However, #has_key? then needs to be renamed to or aliased as #have_key?. I also like the anonymous suggestion to require 'english_grammar' :). ---------------------------------------- Feature #5555: rename #include? to #includes? http://redmine.ruby-lang.org/issues/5555 Author: Alexey Muranov Status: Open Priority: Normal Assignee: Category: Target version: Shouldn't the #include? method be renamed to #includes? ? I think this will be closer to correct English and consistent with #has_key? method (not #have_key?). -- http://redmine.ruby-lang.org