Bikeshed opportunity: filter/map/reduce naming
Howard Lovatt
howard.lovatt at gmail.com
Mon Dec 3 21:25:23 PST 2012
I don't like the names map, because it is already used for Map, and I don't like filter because it isn't clear what it does. My preferred names are recycle and retain respectively. Retain because it is clear what it does and because it is the term used already in the collection library. Recycle because it is descriptive, generating something new from something old, and because recycle, retain, reduce is an alliteration and therefore easy to remember.
-- Howard.
Sent from my iPad
On 01/12/2012, at 10:27 AM, Brian Goetz <brian.goetz at oracle.com> wrote:
> [ Second try, hopefully right list this time ]
>
> Hey, kids, its bikeshed time again!
>
> The topic today is: filter, map, reduce. Should they be called something else?
>
> (No, Don, we're not going with the Dr. Seuss names. :)
>
> But, people have complained about filter because they can't tell whether we are filtering OUT the elements matching the predicate, or including them. Some of these people have suggested "where(Predicate)" as an alternative. Which seems OK to me.
>
> Others find "map" too math-y. (The alternatives I can think of are also math-y; project, transform, apply).
>
> Further, "reduce" and "fold" are unfamiliar to many Java developers. The .NET folks went with "aggregate" to describe their reduction/folding operations.
>
More information about the lambda-libs-spec-observers
mailing list