|
|
|
|
|
by antihero
2587 days ago
|
|
The idea of "editing" stuff instead of creating new versions of them. Whilst mutable programming is faster on write, it is much more difficult to figure out if something has changed, so any function that needs to only do work when stuff has changed (e.g. a React component), it is much much better to use immutable style programming because you only have to see if the memory address has changed as opposed to deeply compare current and previous objects. |
|
IMHO, if you're doing deep compare on anything for any reason, it's usually a sign that the data model is on a shaky ground.