Ep 041: Why do Clojurians make such a big deal about immutability?
► Play EpisodeEach week, we answer a different question about Clojure and functional programming.
If you have a question you'd like us to discuss, tweet @clojuredesign, send an email to feedback@clojuredesign.club, or join the #clojuredesign-podcast
channel on the Clojurians Slack.
This week, the question is: "Why do Clojurians make such a big deal about immutability?" We cover several practical side effects of immutability and why we've become such big fans of data that doesn't let us down.
Selected quotes:
- "Well, we don't have Monads to talk about."
- "What good is a program, if you can't change stuff!?"
- "The memory cost of data structures is in proportion to the changes, not the users."
- "I can hang on to a reference to the old state and a reference to the new state very cheaply."
- "You can reduce comparison to referential equality."
- "Once you can efficiently save every version of the state, going back to a previous version is no big deal."
- "I love determinism. Determinism is trustable."
- "I can trust immutable data. And if I can trust it, then it can occupy a smaller part of my brain."
Related episodes: