Convenience Collector forms
Tim Peierls
tim at peierls.net
Tue Apr 9 06:27:06 PDT 2013
On Mon, Apr 8, 2013 at 10:32 PM, Joe Bowbeer <joe.bowbeer at gmail.com> wrote:
> Q: Why is the method on the block called counting() instead of the
> proposed count()?
>
I like the adverbial form because it reads more like English.
Except for possibly count(), I'm not liking any of these, because:
>
> 1. There is already enough exposed "reduce" surface area in max/min/sum.
>
> 2. map/reduce is where it's at. It's easier for me to read code that uses
> those familiar forms than it is to familiarize myself with a bunch of new
> convenience methods.
>
> I don't think these new forms are going to make Collectors easier to
> learn, or collectors code easier to read (except at a very superficial
> level).
>
I think there are many folks for whom these convenience Collectors will
make the difference between ignoring and using streams. As long as they're
bundled as static factory methods in a Collectors class, I don't see the
problem.
--tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/attachments/20130409/7abfe8ac/attachment.html
More information about the lambda-libs-spec-experts
mailing list