Bikeshed opportunity: filter/map/reduce naming

Brian Goetz brian.goetz at oracle.com
Fri Nov 30 15:27:48 PST 2012


[ 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