The Dark Side of Java 8 - Lessons Learned
summary
Java 8 has concrete pitfalls and concrete fixes: flatMap eagerly evaluates nested streams, which can fully materialize infinite or large inner collections and is fixed in JDK10; filters don’t short‑circuit ordered data until you use takeWhile in JDK9; parallel streams run on a shared ForkJoinPool so tasks and parallelism are surprising unless you know the defaults; lambdas can be coerced to throw checked exceptions via type inference hacks; Stream.generate is unordered and Optional treats null as empty — watch for semantic gotchas.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 6:00Conditional Stream Termination
- 10:08Lazy Semantics
- 19:18lambda expressions vs checked exceptions
- 24:48parallel processing
- 25:54multiple questions
- 31:46follow up
- 33:17streemgenerate
- 38:00Optional vs Option
related talks
32mThe Dark Side of Java 8
49mJava 8: the good, the bad and the ugly
46mStreams in JDK 8: The Good, the Bad, and the Ugly
01h 05mJava 8: The Good, the Bad and the Ugly
49mJava Streams: Beyond The Basics
47mBeyond lambdas, the aftermath
57mTen Common mistakes made in Functional Java
01h 07mJava SE: Lambdas, Streams & Future Directions
