by TimMurnaghan · 9y ago · 0 comments
In what way does functional make state explicit? If I look at a structure (if you have one in your language) and ask who changes this part of it across a large code base - it's much worse when you've just got a bunch of functions (with bad names) which can be hiding anywhere.
And the "reasoned about" shibboleth. What "reasoning" do you actually do.
Don't get me wrong - I have a long history in Lisp and ML and they're good languages in which good people can write good software. But no magic bullets.
In another part of the development world I've seen React programmers jumping on the functional bandwagon and deciding that all components have to be stateless. Taking the state outside the components means that we have lots of bugs with mistaken state sharing. So external state doesn't equal well-managed.
The exception is the IO entry point.
There is a lot of opportunity to sandbox things so that if you know the type of the function you know what it can or can't do to the programs state.