DEV Community

Discussion on: Immutability Benefits

Collapse
 
maroun_baydoun profile image
Maroun Baydoun

Immutability ensures quick change detections. If we are guranteed that any change will create a new version of our data, knowing that a change has happened becomes a matter of a simple reference compariason between the current and the previous data. Thus eleminating costly deep object comparaisons. This is particularly helpful with deep nested data structures that would be expenisve to traverse and compare.

Collapse
 
jwp profile image
John Peters

Yes, reference comparisons tell us there is a difference quickly.