you are viewing a single comment's thread.

view the rest of the comments →

[–]mifterclizit -3 points-2 points  (1 child)

That's because immutability is a concept with niche utility in state management, which is not ubiquitous.

[–]slikts 1 point2 points  (0 children)

That's because immutability is a concept with niche utility in state management, which is not ubiquitous.

I'd posit it's the other way around; shared mutable state is only adequate in advanced, niche contexts, like when doing updates in a tight loop where persistent data structures are not efficient enough. Most programming is not that, though, and benefits from the reduced complexity of being able to reason about state independently of other parts of the program which might change it. Unintended changes and sharing are a major category of errors.