Updated State of the Lambda

Martijn Verburg martijnverburg at gmail.com
Fri Dec 9 12:46:21 PST 2011


Hi Brian,

A couple of comments from me (_very_ much an end user as opposed to a
language expert):

1.) I love the fact that this is going to reduce the number of
anonymous inner classes that us developers are tempted to use.
Nothing makes my optimism take a nose dive when helping debug a
client's code and they start talking about the "38 anonymous inner
classes we'll get to look through"

1.b) I appreciate that you guys have thought about possibly dealing
with arbitrary capture of mutable variables and nonlocal control flow
in a future version of the language.  One step at a time I think is
sensible (especially as you'll get to see more usage patterns when 8
is adopted), but I'm happy it's being thought about as anonymous inner
classes like reflection should not be the first tool on the developers
toolbelt (IMHO anyhow).

2.) I really like the 'functional interface' naming of what was
formerly a SAM type - it makes a whole lot of sense to me and I
suspect a lot of other developers.

3.) Tooling support for the some of the rules of lambda could be
interesting to implement (especially around target typing).  If it
helps we can try to reach out early to the IDE guys (in particular) to
get them thinking about these issues.

3.a.) I like the analogy of target typing being similar to the diamond
operator in 7.  Since the Diamond operator is easily understood by
developers, this will be a useful way of teaching it.

4.) Being able to do this:  List<String> ls =
Collections.checkedList(new ArrayList<>(), String.class);

Is awesome, I have a use case for that right now :-)

5.) I liked the last section which ended up with
people.sort(comparing(Person::getLastName)); it explains the reasoning
well, a few things clicked.

Great stuff Brian and pass on my thanks to the EG as well - to my end
user eyes this looks like it is ticking along nicely.  Language gurus
may of course have more indepth/valuable feedback to give.

Oh and a comment on syntax.  We've got until well into 2012 to sort
that out, so lets keep worrying about the semantics.  I for one hope
that a lot of continued thought goes into the interaction between
generics and lambdas as opposed to whether we use -> or --> etc.

Cheers,
Martijn






On 9 December 2011 18:28, Brian Goetz <brian.goetz at oracle.com> wrote:
> An updated State of the Lambda is available here:
>
>   http://cr.openjdk.java.net/~briangoetz/lambda/lambda-state-4.html
>
>


More information about the lambda-dev mailing list