Here are a few thoughts in response to your questions:
- Lambda expressions will significantly improve readability and reduce noise in Java code by allowing for more concise one-liners compared to anonymous inner classes. However, debugging lambdas could potentially be more challenging since they are anonymous by nature. Tools and IDE support will need to evolve to help with this.
- With features like lambdas and default methods, Java 8 aims to become more competitive with languages like C# and Scala that already have closures and functional capabilities. However, Java's large existing code base and ecosystem give it advantages over newer languages.
- For Java 8 to be widely adopted, projects should start evaluating and migrating to it as early access
12. (Anonymous) Inner Class
A λ Solution
Iterables.filter(persons,
new Predicate<Person>() {
@Override
public boolean apply(Person person) {
return person.getAge() >= 18;
}
}); // Java + Guava
13. (Anonymous) Inner Class
A (better?) λ Solution
Iterables.filter(persons, IS_ADULT);
Predicate<Person> IS_ADULT
= new Predicate<Person>() {
@Override
public boolean apply(Person person) {
return person.getAge() >= 18;
}
});
This is what you really need!
14. (Anonymous) Inner Class
(Not Really) A λ Solution
● "The pain of anonymous inner classes makes us roll
our eyes in the back of our heads every day." (a wise
Oracle's client, 01/2011)
Average length of Java one-liner is 21 line!
@DEVOPS_BORAT - 12/09/2011
15. What about Oracle?
● "It’s time to add closures to Java" (Mark Reinhold,
12/2009)
● "Oracle's position is that Java must evolve -- carefully,
of course -- in order to remain competitive." (Brian
Goetz - 08/2011)
22. VEM
Motivation
VEM
eg. Collection API
Help to extend existing APIs
Minimize rewrite of existing
API implementation
eg. Hibernate Collection
Implementation
23. Collection API Extended
java.util.functions.*
java.util.streams.*
Extension of Iterable, Iterator, Collection, Map, ...
java.util.Optional
31. Around Project Lambda
OpenJDK OSX Build (7 & 8)
http://code.google.com/p/openjdk-osx-build/
H. Gomez
Java 8 vs Scala: a Feature
Comparison
http://www.infoq.com/articles/java-8-vs-scala
S. van den Berg
U. Peter
32. Around Project Lambda
In France
JDK 8: lambdas in Action [FR]
http://www.devoxx. O. Croisier
com/display/FR12/JDK+8+demo++lambdas+in
+Action
G. Tardif
Java 8 et les Lambda [FR]
http://thecodersbreakfast.net/index.php?
post/2012/05/30/Java-8-et-les-Lambda
Curious about Project Lambda ;)
http://blog.xebia.fr/ [FR]
http://kerflyn.wordpress.com/ Guess
Who?
33. Project Lambda
and the Community
● Transparency
○ Presentations / Publications
○ Source code available
● Early testing by community
○ Pre-version available
○ AdoptOpenJDK (http://java.
net/projects/adoptopenjdk/pages/AdoptOpenJDK)
● Quick feedback
○ ML, Hackdays
34. Question
● Oneliner, Readability, and Debugability
● Java vs. Competitors
● What to do for Java 8 to be adopted in
projects?
● Is there a future for Java?