DEV Community

loading...

Discussion on: What Do You Think About Immutable Data?

Collapse
solkimicreb profile image
Miklos Bertalan Author • Edited

Thanks for the awesome comment. I really enjoyed it as a whole but I will highlight a few parts for further discussion if you don't mind.

"to keep our state in consistent state"

This is a bit vague for me. How is mutable state inconsistent?

"All race/deadlock conditions, concurrent update problems go away"

This is true for multi-threaded languages but I don't think this is an issue in case of (the mostly single-threaded) JavaScript.

"also provide other benefits such as memoization, time travel, etc"

I totally agree with this one, immutable updates really shine here.

PS: Thanks for the link to the book.

Collapse
dance2die profile image
Sung M. Kim

Thanks for the feedback, Miklos.

This is a bit vague for me. How is mutable state inconsistent?

What I meant was variables don't change thus wherever you access that variable, it's always the same (consistent).
Maybe it came out wrong 😅