Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Immutability

Name: Anonymous 2014-03-15 3:20

Aside from the case of reads and writes of reference types in the context of concurrency, what's so good about immutability?

Name: Anonymous 2014-03-15 4:47

Not counting concurrency?
You can share the same copy of a value among all uses of the value. This extends to parts of the value (substrings, subtrees, or tails of lists) and across multiple functions and multiple threads. You have a guarantee from the compiler that the value will always be the same. If that value's a huge array (say, an image file) or binary tree, that's a big savings in memory and time spent making unnecessary copies.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List