From: Robert Dober Date: 2006-09-29T06:54:19+09:00 Subject: Re: String starts? and ends? methods ------=_Part_61761_23314141.1159480456178 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 9/28/06, Pete Yandell wrote: > > > On 28/09/2006, at 12:36 PM, Marcelo Alvim wrote: > > > On 9/27/06, Pete Yandell wrote: > >> For non-predicate methods, the second person makes sense. Take > >> String.squeeze for example...that's really about you (the second > >> person) squeezing the string. > > > > Sorry for entering this thread now to give my two cents. I'm sorry > > because I'm a Ruby newbie AND a non-native english speaker, but I > > thought I should say this. > > > > I don't think the person is really the question here. I think it's the > > imperative form of the verb. > > In that case, I have always interpreted that (both in english and in > > my native language) as you telling the string to squeeze itself. > > File.open, for example, reads like "Hey, File class, open this for me, > > please". I'm imperative, but polite :). > > I think you're absolutely right Marcelo, and you've once again proved > that non-native English speakers tend to know way more about grammar > than native English speakers like me. :) > by force of nature, we have to study it to learn, OTOH method names ending in "?" are hardly imparative forms [ I guess that was what Pete was refering to] but why not making things easier and being more tolerant :) in the beginning I had to correct #responds_to? with #respond_to? what seemed a zillion times (I should have aliased it in Object anyway, but when I knew how to do that I did not need it anymore ;) . Aliases are commonly used in Ruby Array#collect, Array#map etc why not having them for flected forms String#starts_with? <=3D> String#start_with? personally I like String#prefix? and String#suffix? too, shorter and very precise. Object#responds_to? <=3D> ... I guess it will make life easier for Newbies and let everybody use it's personal feeling for what sounds better. Cheers Rober Pete Yandell > > --=20 Deux choses sont infinies : l'univers et la b=EAtise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------=_Part_61761_23314141.1159480456178--