4 ms·
I think immutability (or immutable state) adds one big advantage over mutable state: you have access to previous state(s) and the current state. Immutability i
by odipar 5y ago
I think immutability (or immutable state) adds one big advantage over mutable state: you have access to previous state(s) and the current state.
Immutability is very convenient for checking post-conditions that compare previous states and the current state for certain properties that should hold (temporal properties for example).
In turn, post-conditions guard your states to be sane.