From: Robert Klemme Date: 2004-09-30T15:05:03+09:00 Subject: Re: Too Many Ways? "Gavin Kistner" schrieb im Newsbeitrag news:C3144C65-1285-11D9-BDE2-000A959CF5AC@refinery.com... > At what point do you cross over from: > "Various ways to accomplish the same goal is good, > because it allows the language to work the way > different people think about working." > into the land of: > "Duplicate names and techniques to do the same > atomic thing ends up confusing the nubys" > ? > > results = my_array.collect{ ... } > results = my_array.map{ ... } IMHO these were introduced to match other languages notations. I think it makes life easier for newcomers. > a = Proc.new{ ... } > b = lambda{ ... } Same here. > def whee; ...; end > c = self.method( :whee ) These are two completely different cups of tea. > def foo &blockAsBlock > blockAsBlock.call > yield > end Same here: the &b notation converts the block into a proc making it possible to store it somewhere or pass it on. > def bar blockAsParam > blockAsParam.call > end I'd consider this a different case, too, because here the block can't be handed over via "foo { ... }". > Regexp globals vs. MatchData > #insert your own examples here *That* is an area where I definitely like to see improvements (see the thread some time ago about String#scan and MatchData). On the whole I feel pretty comfortable with the way Ruby does things although I recognize a certain tendency to increase redundancy ("lambda" and "proc" comes to mind). As far as I remember I wasn't confused when I was a RubyNuby. But then again, everybody feels different about this. Kind regards robert