Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What you're describing are just plain bad coding practices by people who didn't understand concurrency. Proper locking and synchronization are the real fixes.

Again, that's not to say that immutability never has a place.



Concurrency is hard. Immutability skates around the whole problem. A parser should be immutable, parsing state should be limited to a particular invocation of the parser.

Of course, mutable state cannot be abolished everywhere (often for efficiency reasons). In such cases, you should indeed understand the concurrency primitives.


As a C++ programmer, I make sure that things that can reasonably be const are const, because that reduces the number of places where things can go wrong.

That said, sometimes state simply has to change, and anything else is just ideology.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: