From: Gavin Kistner Date: 2004-09-30T22:28:07+09:00 Subject: Re: Too Many Ways? On Sep 30, 2004, at 7:12 AM, Chris Pine wrote: > (Yes, if you are teaching Ruby to a functional programmer, you use map > instead of collect (are those really the same? I just always avoided > collect: wrong english word, I think), but you still teach them only > *one* of them.) Funny, I never understood what #map did. People used it all the time and it baffled me. I kept saying "I should learn this method, because people keep showing how to use it for powerful, terse solutions, but...I'm baffled." Then someone showed me the #collect method, and I fell in love. It's awesome. I extended arrays in Javascript to use it, I love it so much. ...it was a week later than I pulled up the documentation and saw that they're the same thing. Something about 'map' made absolutely no sense to me (it implies a hash-like permanent connection between the old and the new), and collect made perfect sense (go traipsing through the entire field of daisies, picking up only the best ones). So if we were deprecating duplicates, I vote to get rid of #map. (This is the part where 100 rubyists say "No! #collect sucks, #map is king!" and my entire argument for less duplication is shot down by the fact that people like different things.) -- (-, /\ \/ / /\/