Java 8: The Good, the Bad and the Ugly
summary
Shows concrete anti-patterns found in real code reviews and supplies runnable samples in an open repo (one external PR so far). Demonstrates wrong versus better code for Optional.of/empty usage, replacing nested presence checks with Optional.orElseThrow and using flatMap to avoid nested Optionals. Covers stream mistakes: long lambdas, misused forEach, returning one-time Streams, and boxing costs solved by IntStream. Gives working replacements and explains when each approach beats the naive version.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 5:45Java 8 GC
- 18:26Lambdas best practices
- 25:28Functional interfaces
- 38:15Stream anti-patterns
- 54:41Specialized streams
- 1:03:29Summary
related talks
49mJava 8: the good, the bad and the ugly
46mStreams in JDK 8: The Good, the Bad, and the Ugly
47mThe Dark Side of Java 8 - Lessons Learned
55mFunctional Programming Patterns with Java8
47mBeyond lambdas, the aftermath
49mTen Common Mistakes Made in Functional Java 1
57mTen Common mistakes made in Functional Java
37mPragmatic Functional Refactoring with Java 8
