3 ms·
I have to admit, I find it odd that we name immutable data structures based on what they don't do instead of what they do. Of course, what they do is efficient
by Strilanc 12y ago
I have to admit, I find it odd that we name immutable data structures based on what they don't do instead of what they do.
Of course, what they do is efficient persistence. You want a snapshot of the data? You want a non-volatile reference? You've already got one! That's the feature. They should be called persistent data structures.
- the_af 12y agoI'm sure you are aware in many cases they are indeed called persistent data structures: http://en.wikipedia.org/wiki/Persistent_data_structure http://en.wikipedia.org/wiki/Persistent_data_structure
- TheLoneWolfling 12y agoYou can have an efficiently persistent data structure that isn't immutable. For example, a rope that reorganizes internal nodes to maximize structure sharing.
- leebyron 12y agoThat is true! In fact, an earlier version of this library was called "persistent-js", and I know this is a pretty subtle distinction - I found it easier to talk to people about when I talked about it via immutability and so I ended up naming the library that way.