3 ms·
This is a fair point: immutable data is just part of the solution. To get the win, you need to toss out all references to the old data when you update it: then
by omgwtfpmr 10y ago
This is a fair point: immutable data is just part of the solution. To get the win, you need to toss out all references to the old data when you update it: then you ensure that you can't access "stale" data. This requires some discipline, either manual (e.g., reusing the same variable name for the old and new bindings to ensure the stale binding is shadowed) or automatic (e.g., linear types).