Functional Programming Anti-Patterns in Java
summary
Using Java and Hibernate, making entities immutable regularly backfires; cloning immutable collections (example: Kotlin fold) can allocate 400 MB for 5,000 elements. Loops that create an empty list then add are an anti-pattern—replace accumulator loops with streams + collect, prefer peek over misused map for side effects, and use max instead of complex reduce so avoid reduce. IntelliJ quick fixes can hide mutations. CompletableFuture pain points fade with Java 21 Virtual Threads; only two teams saw real latency issues (≈50 microseconds).
AI-written summary · about
chapters (11)
- 0:00Introduction and speaker intro
- 1:25Functional programming in Java basics
- 3:55Immutable objects pitfalls
- 8:12Anti-patterns with loops
- 10:19Misusing streams and side effects
- 15:32Functional chainsaw and overcomplication
- 21:10Exceptions and monads misuse
- 24:44Optional anti-patterns
- 27:55High-order function risks
- 29:40Reduce anti-pattern deep dive
- 33:14Conclusion and community invite
related talks
49mTen Common Mistakes Made in Functional Java 1
57mTen Common mistakes made in Functional Java
42mPure Functions and Immutable Objects
55mFunctional Programming Patterns with Java8
01h 44mFunctional Programming: Technical Reasons to Adapt
15mHow to Write Bad Java Code
36mHow functional programming change my Java code
46mDesigning Functional Programs
