The Hitchhiker Guide to Pure Functions and Immutable Objects
summary
Defines pure functions as side‑effect free and deterministic, shows Java cannot enforce purity at compile or runtime, and prescribes a concrete pattern: isolate a functional core of pure functions and surround it with an imperative shell that does I/O. Demonstrates Java techniques: use self‑validating constructors, immutable value objects (use records on Java 17 or Lombok pre‑17), refactor with split‑phase to push reads/writes outward, avoid mutating collections (cloning lists hurts GC), and notes memoization of pure functions remains pure.
AI-written summary · about
chapters (7)
- 0:00Introduction and speaker background
- 1:49Problems with impure code
- 9:12Pure functions explained
- 17:12Why immutable objects matter
- 25:39Value vs reference objects
- 30:52When to use immutability
- 31:33Q&A: Memoization and purity
related talks
42mPure Functions and Immutable Objects
34mPrinciples of functional programming with examples in Java and Haskell
46mDesigning Functional Programs
31mA Primer on Functional Programming
48mEmbrace the Func - How Far has Functional Programming Come in Java?
01h 44mFunctional Programming: Technical Reasons to Adapt
51mFunctional Principles for Object Oriented Development
52mImmaculate Code (pure code)
