Learn how Clojure makes immutable values practical on the JVM through persistent collections, structural sharing, and explicit state boundaries.
In Clojure, immutability is not “a best practice.” It is the default. When you “change” a vector or map, you get a new value back, and the old one is still valid.
The key idea that makes this practical is structural sharing: the new collection reuses most of the old collection’s structure instead of copying everything.
assoc, update, conj, dissoc to produce new values.Java mental model:
finalreferences and unmodifiable collections are optional in Java. In Clojure, “no in-place mutation” is built into the standard data structures.
Once you trust immutability, many other Clojure idioms become obvious: concurrency is safer, tests are simpler, and refactors have fewer hidden coupling points.