Remix.run Logo
empiricus 2 hours ago

"No statechart will survive contact with real world applications". I mean, when you have external dependencies, multilayer protocols, multithreading, perf requirements, the state will becomes an ugly mess. One can only dream of a clean statechart.

hogehoge51 an hour ago | parent | next [-]

Hierarchical state machines are common in hardware development. I've also used them for embedded systems, and dug my way out of spaghetti nightmares in distributed systems by reworking a system into a set of state machines.

Is it clean? Not always, it gets messy. On the other hand it is deterministic and traceable to specifications. Specifications as state machines can be easier understood and shared than raw code or raw prose.

I also think more effort is needed to synthesize a clean set of state machines with hierarchy for a system at scale and I'm sure there are times when that effort is not warranted.

sghiassy 27 minutes ago | parent | prev [-]

I’ve used state charts in multi-billion legacy apps and they’ve stayed quite clean.

Just don’t use one state chart for everything. Just like any data structure, use multiple of them scoped appropriately