3 ms·
People started caring about mutability out of two reasons I would say: - It’s a source of thread-safety bugs. With multiple cores even in phones and async prog
by legulere 8y ago
People started caring about mutability out of two reasons I would say:
- It’s a source of thread-safety bugs. With multiple cores even in phones and async programming rising this has become a bigger issue.
- It’s a source of general program logic bugs.
I wouldn’t say that it has come all of a sudden. Like other modern techniques it has been standard in functional programming for years. In mainstream programming languages it’s also not totally new, for instance immutable strings were a design decision in java.
- invaliduser 8y agoYou are so right for the thread-safety, immutability is a major improvements. However, I am pretty sure OP was referring to immutability in javascript, which is single-thread by design, and yet many javascript developers use immutability like a no-brainer and is seen as best-practice to the point where people don't even remember what it solves. Just that it must be used.