3 ms·
Since this thread mostly only seems to get into why state machines are great, I wanted to see what else there is on the other side. You rarely see state machine
by eatonphil 3y ago
Since this thread mostly only seems to get into why state machines are great, I wanted to see what else there is on the other side. You rarely see state machines in application development (backend or frontend). And if I saw it there I'd think someone was making overcomplicating things.
https://workflowengine.io/blog/why-developers-never-use-state-machines/ https://workflowengine.io/blog/why-developers-never-use-stat...
On the other hand, programming in state machines makes more sense when you're dealing with network protocols like TCP or distributed systems like Raft (both the implementation of Raft and the clients of Raft are modelled as state machines).
It's hard for me to explain why state machines feel like overkill/overengineering in application development but feel natural in network and distributed systems programming.
- giraffe_lady 3y agoI have seen state machines quite frequently in production code, but rarely formally defined state machines. For example something I've seen a few times is a db table with the fields "account confirmed bool" "account_deleted bool" and "account_suspended bool." There's a state machine in that app somewhere, even if they wouldn't describe it that way. I think developers having better awareness of when they're drifting into this approach and intentionally choosing it or not would be a much better situation.