~/talk

The Hitchhiker Guide to Pure Functions and Immutable Objects

Talkat jLove 2020 · 2020-12-04..12-05· [java, functional-programming]
slides:none on file

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

  1. 0:00Introduction and speaker background
  2. 1:49Problems with impure code
  3. 9:12Pure functions explained
  4. 17:12Why immutable objects matter
  5. 25:39Value vs reference objects
  6. 30:52When to use immutability
  7. 31:33Q&A: Memoization and purity
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.