4 ms·
The problem is that whether or not we have shared mutable state on a logical level is not for us to choose. It's ultimately a property of the task at hand. Push
by fauigerzigerk 13y ago
The problem is that whether or not we have shared mutable state on a logical level is not for us to choose. It's ultimately a property of the task at hand. Pushing shared state onto the database doesn't make it go away. Workarounds like MapReduce or monads only help us defer the moment of truth. If shared mutable state is what users ultimately expect to see, these approaches are merely simulations of shared mutable state that exploit a time gap in users' perception.
That gap is very brittle. Nightly batch windows become too short. Users expect real time updates leading to major redesigns of entire systems, like Google dropping MapReduce for their search index.
But I think your point about state being the major difference between OO and FP is absolutely true. In OO systems, statefulness is the default everywhere. Nothing is formally known about state in OO system and that is a bad thing. We need state to be explicit and formally specified.