3 ms·
A shadow DOM. A state manager ;). A protocol implementation which needs state. There are cases where the domain has state. Like said, typically, for request/res
by oaiey 6y ago
A shadow DOM. A state manager ;). A protocol implementation which needs state. There are cases where the domain has state. Like said, typically, for request/response cases which is 90% of everything we program nowadays, this state is typically loaded from somewhere else. I am also not particular arguing for OOP here. It is just the absolutism which are an issue.
- t0astbread 6y agoWhat about an "update(state, event) -> NewState" design for state machines and stateful protocols?
- necovek 6y agoA DOM is a huge hierarchical data structure and not much else (sure, it has function pointers too, but that's pretty much it). You can easily turn things into substructures and have functions only work on those: whether you pass by reference or value is up to you and your choice of language, but even when passing by reference (to avoid memory copying), you can write functional code. Again, it sure is non-idiomatic for most languages, but that does not mean it's impossible or even hard. As far as "absolutism", generally, aiming for minimal statefulness will help you write more maintainable code (citation missing :).