|
|
|
|
|
by XorNot
680 days ago
|
|
Immutable by default is only really possible now that we have gobs of memory though. I'm not even sure it's likely to stay popular: the demands of data processing at scale mean we're all likely to be routinely handling gigantic datasets which we don't want to copy all over the place. The real problem is just visibility: am I editing a copy of the original? Who else can edit the original? Who's going to? I'd argue those two questions are what we actually want to know the answer to, and immutability criteria are just an awkward compromise solution. |
|
And at the function-local level move elision should turn copy-and-modify to in-place modification if the original is no longer used.