3 ms·
> Immutability is a drag if you create lots and lots of referenced state because, e.g., you want to hold on to many snapshots of past state. Isn't it the oppos
by fnordsensei 5y ago
> Immutability is a drag if you create lots and lots of referenced state because, e.g., you want to hold on to many snapshots of past state.
Isn't it the opposite? If you want to hold on to many referenced states at the same time, an immutable data structure should provide less overhead than a mutable one, due to structural sharing.
- cryptonector 5y agoA performance drag. Let's say you have an app that for N inputs creates N^2 state in memory... But now, if that's just what you must do for some reason, then, yes, immutability makes the task of taking all those snapshots real easy.