Consider unit testing. With global state, it gets harder to keep things clean; requires more "resetting" type code.
Re:Clojure, the Good Parts
by aosullivan on Friday April 22, 2016 @01:04PM
(#11550638)
You are right. Params can be references to state, either as an atom or ref, or to a function which accesses external state (e.g. a database). The idea that params somehow obviate the need for state overlooks that.
Re:Clojure, the Good Parts
by VogonWorkEthic on Tuesday April 19, 2016 @08:02PM
(#11531436)
no, they're just data being passed in. at least thats what it sounds like to me.
obviously this data has ways to manipulate the world, because an app that did nothing would be pointless. but it's no different than any other param.
what would be bad, which is pretty much the opposite of this situation, is if you had global resources that werent passed in as params and caused side affects and you had to access a global variable to get to it (because it wasn't passed in).
If not, can you elaborate?