Ten Common mistakes made in Functional Java
summary
Ten concrete Java pitfalls with fixes and code patterns: avoid large block lambdas — extract named methods; stop returning Streams as reusable data; never rely on peek for side effects or mutate shared objects in map — return new immutable copies; replace repeated forEach stages with a single pipeline to speed batch jobs; order operations correctly (distinct vs limit) and avoid accidental infinite streams; use Optional APIs (map, ifPresent, orElseGet) instead of isPresent/orElse side effects; handle checked exceptions in lambdas by lifting to Either or using Vavr Try.
AI-written summary · about
chapters (18)
- 0:00Intro
- 2:27Introduction
- 5:48Doing too much in a single lambda
- 8:57Returning a stream
- 14:34Mutable objects
- 15:05Functional programming
- 16:23Mutable data
- 17:16State changes
- 22:50What is functional programming
- 25:56Order of operations
- 27:19Unit test
- 33:57If Statement
- 45:36Exception
- 46:01Block lambdas
- 47:46Checked exceptions
- 50:56The eater type
- 52:01The lift type
- 53:36The pair type
related talks
49mTen Common Mistakes Made in Functional Java 1
55mFunctional Programming Patterns with Java8
56mJava Functional Programming Idioms
46mDesigning Functional Programs
49mJava Functional Programming Idioms
47mBeyond lambdas, the aftermath
57mLearning To Code In Functional Style with Java
47mThe Dark Side of Java 8 - Lessons Learned
