3 ms·
Isn't your use of an env as a parameter just another form of global state? If not, can you elaborate?
by DigitalJack 11y ago
Isn't your use of an env as a parameter just another form of global state?
If not, can you elaborate?
- raould42 11y agoConsider unit testing. With global state, it gets harder to keep things clean; requires more "resetting" type code.
- VogonWorkEthic 11y agono, 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).
- aosullivan 11y agoYou 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.