7 ms·
I think a switch or an if/else expresses this really clearly though and also prevents impossible states.
by davnicwil 4y ago
I think a switch or an if/else expresses this really clearly though and also prevents impossible states.
- capableweb 4y agoAs a huge proponent of Statecharts, I agree. If what you're doing is really simple and only have a few amount of states (as conditionals introduce those states no matter if you use state machines, statecharts or conditions), it makes sense to keep things simple. But once you start having much more than that, or nested states, Statecharts makes it really easy to build reliable, performant and easy to change flows.
- davnicwil 4y agoI can see that. Do you have some examples of common UI usecases which are the other side of the line here and for which statechart based code is better?