Java 8: the good, the bad and the ugly
summary
Java 8 adds lambdas, Optionals and streams but the talk gives actionable limits: lambdas replace boilerplate but avoid block lambdas and prefer single-line or named helpers; plain Java 8 cannot throw checked exceptions inside lambdas so wrap or rethrow as RuntimeException or use utility wrappers; Optionals are for return values only and must never be assigned null; streams are lazy and single-use so streams are lazy and single-use — don’t return them, beware infinite streams and the shared parallel fork/join pool.
AI-written summary · about
chapters (22)
- 0:00Start
- 5:47Why Java 8
- 9:10Functional Interfaces
- 11:08Java 8 Comparator
- 12:55Abstraction
- 14:50Writing a lambda
- 18:16Don't do Block Lambda
- 20:21Type inference
- 21:08Parentheses
- 21:51Exception handling
- 22:51Checked Exceptions & Lambda
- 24:51Exception Utility
- 28:47Using Optional
- 33:14JAVA 8 Streams
- 34:12Stream Example
- 35:52forEach ??
- 38:02Puzzler
- 42:31Consume the stream
- 43:23Multiple filters
- 44:19Infinite stream
- 45:56Watch out with parallel
- 47:24Summary
related talks
01h 05mJava 8: The Good, the Bad and the Ugly
47mThe Dark Side of Java 8 - Lessons Learned
01h 07mJava SE: Lambdas, Streams & Future Directions
50m10+ new features you ought to know using Java 8
01h 25mJava 8 Language Capabilities, What's in it for you?
47mBeyond lambdas, the aftermath
32mThe Dark Side of Java 8
46mStreams in JDK 8: The Good, the Bad, and the Ugly
