3 ms·
> Should it be completely abandoned? I'm not so sure. Nobody is trying to abandon mutable state (or nobody should, at least). If we abandoned it, our computer
by kaoD 12y ago
> Should it be completely abandoned? I'm not so sure.
Nobody is trying to abandon mutable state (or nobody should, at least). If we abandoned it, our computer would be a static screen where nothing would happen.
Functional programmers embrace mutable state, but only where it's needed! If the program is faster or cleaner using mutable state, why not? Check some of Clojure's mutable constructs as an example:
http://clojure.org/vars http://clojure.org/vars | http://clojure.org/Refs http://clojure.org/Refs | http://clojure.org/Atoms http://clojure.org/Atoms | http://clojure.org/transients http://clojure.org/transients
- taeric 12y agoThe dream is typically, as I understand it, that the compiler can figure out all of the places where mutable state is required. Don't get me wrong, I realize most folks are more pragmatic than they are dogmatic. However, I also know that all of my coworkers and most folks I have talked to are obsessed with "persistent" collections. Often touting them as some sort of must have for reliable multithreaded work.