DevoxxUK Lambdas Lab

Stephen Colebourne scolebourne at
Wed Apr 3 03:34:10 PDT 2013

My experience (part 1):

The afternoon did not start well, with some pretty basic inference problems:
This works:
 ToIntFunction<String> ref = String::length;
This doesn’t work:
Nor does this work:
 strs =;

This works:
 strs.sort(Comparators.comparing((String s) ->
This doesn’t work:
 strs.sort(Comparators.comparing(s ->
Nor does this work:
 strs = ->

In other words, both of the obvious (to me) ways to code this problem
(sort by length then alphabetically) failed. If these can't be fixed,
I'd be really worried about the usability of lambdas.

On 3 April 2013 09:12, Richard Warburton <richard.warburton at> wrote:
> Last week at DevoxxUK we ran a brief lambdas hackday.  People were
> encouraged to focus on the collectors component of the API through setting
> a few problems to solve.  I appreciate its a bit late in the game as far as
> API changes, but some of these issues are fixable through
> documentation/improved compiler error changes rather than API changes.
> 1. No one complained about the move from “into(new ArrayList<Foo>());” ->
> “collect(toList())” when you explained that the change had been made.
>  However, people didn’t naturally find Collectors.toList() and they did
> express frustration around that.  At least one request for an abbreviated
> toList() method on a stream - more for findability/fluency reasons rather
> than brevity of code.
> 2. ToIntFunction, ToDoubleFunction etc. are all usable with flatMap, but
> the naming confused people as to why.
> 3. Several people requested a way to transform a boxed stream into an
> unboxed stream.  Its pretty easy to go the other way around, but there
> didn’t seem to be any utility methods for making the boxed -> unboxed
> transformation.
> 4. People found “groupingBy” to be a hard conceptual leap.  We had set an
> exercise where people were asked to count the frequency of words in a
> document, in order to force them to use it.
> a. Quite a few people didn’t initially look for a function that collects a
> stream into a map.
> b. When you suggest that they should look for that, they didn’t look for
> something called “groupingBy”.
> c. They did get the concept once you bring up SQL.  With hindsight I wished
> I had enquired about how many people had used LINQ.
> d. People then didn’t grok that they needed to use the multiple argument
> overload of groupingBy, with a reducingBy, in order to complete the task.
>  I suspect that this method needs more documentation examples in order to
> be easily understandable by people.
> 5. People are beginning to get confused by old documentation on the
> internet being out of date.  I hadn’t seen this in previous hackdays.  Even
> an article in the latest Java Magazine is out of date due to the API moving
> so much recently, and so is the official tutorial:
>  Probably not a long term concern - but might be a concern for the first
> few months.
> 6. If anyone else runs this kind of thing and they are a day-to-day eclipse
> user, word of advice to make sure you know how to set the preferred JVM
> location in netbeans and intellij before you run the event!
> Thanks to everyone that attended, and especially to Stuart Marks, Maurice
> Naftalin, Graham Allan and John Oliver for helping out with running the lab.
> There’s a full link with code that people wrote and pasted at, and it also
> contains some more comments by people:
> regards,
> *
>   Richard Warburton
>   @RichardWarburto <>

More information about the lambda-dev mailing list