Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Java 8: The Good, the
Bad and the Ugly
Mikalai Alimenkou
@xpinjection
Oleg Tsal-Tsalko
@tsaltsol
LEAD SOFTWARE ENGINEER AT EPAM SYSTEMS.
PASSIONATE DEVELOPER, SPEAKER, ACTIVE
MEMBER OF KIEV JUG.
PARTICIPATE IN DIFFERENT...
Disclaimer
This talk is based on
personal experience
You could follow code samples
https://github.com/xpinjection/java8-misuses
#1. Optional
Wrap nullable values
in Optional to operate
on them
Use chained
methods
Optional containers
should be short lived
Carefull...
#2. Lambdas
Avoid long or complex
lambda expressions
Prefer reusable
method references
Be concrete with
functional interfaces
Use spec...
#3. Stream API
Don’t mix streams and
imperative code
Avoid complex
nested streams
Don’t use external state
with streams
Take a look at
ex...
And remember…
@tsaltsol
oleg.tsalko@gmail.com
@xpinjection
mikalai.alimenkou@xpinjection.com
Java 8, the Good, the Bad and the Ugly
Java 8, the Good, the Bad and the Ugly
Java 8, the Good, the Bad and the Ugly
Java 8, the Good, the Bad and the Ugly
Java 8, the Good, the Bad and the Ugly
Java 8, the Good, the Bad and the Ugly
Upcoming SlideShare
Loading in …5
×

Java 8, the Good, the Bad and the Ugly

2,783 views

Published on

Java 8 is being around for a while already and lot of us are already using Java 8 features on our projects. But do we use these great Java 8 features correctly and efficiently? Having done lots of code reviews during last years we’ve seen some common antipatterns of Java 8 features usage. In this talk we want to show you some of the examples where Java 8 features were misused or poorly used and show you how certain things could have been better implemented.

Published in: Software
  • Be the first to comment

Java 8, the Good, the Bad and the Ugly

  1. 1. Java 8: The Good, the Bad and the Ugly Mikalai Alimenkou @xpinjection Oleg Tsal-Tsalko @tsaltsol
  2. 2. LEAD SOFTWARE ENGINEER AT EPAM SYSTEMS. PASSIONATE DEVELOPER, SPEAKER, ACTIVE MEMBER OF KIEV JUG. PARTICIPATE IN DIFFERENT EDUCATIONAL INITIATIVES, ENGINEERING EVENTS AND JCP/ADOPTJSR PROGRAMS. MEMBER OF ARCHITECTURE EXCELLENCE INITIATIVE AND ENGINEERING PRODUCTIVITY GROUPS IN EPAM. OLEG TSAL-TSALKO
  3. 3. Disclaimer This talk is based on personal experience
  4. 4. You could follow code samples https://github.com/xpinjection/java8-misuses
  5. 5. #1. Optional
  6. 6. Wrap nullable values in Optional to operate on them Use chained methods Optional containers should be short lived Carefully choose what to wrap
  7. 7. #2. Lambdas
  8. 8. Avoid long or complex lambda expressions Prefer reusable method references Be concrete with functional interfaces Use specific methods on collections
  9. 9. #3. Stream API
  10. 10. Don’t mix streams and imperative code Avoid complex nested streams Don’t use external state with streams Take a look at extensions like jOOL, StreamEx.
  11. 11. And remember…
  12. 12. @tsaltsol oleg.tsalko@gmail.com @xpinjection mikalai.alimenkou@xpinjection.com

×