DEV Community

Discussion on: No, disabling a button is not app logic.

 
davidkpiano profile image
David K. 🎹

Tell that to the many developers using state machines in user interfaces already (for years) with great success.

Of course it's not applicable for every use-case, but saying it's rarely useful without evidence is not helpful.

Thread Thread
 
macsikora profile image
Pragmatic Maciej • Edited

Nobody argues that every app form a state machine. The argue is should it be explicit or implicit one. I am for making not possible state not possible, but I see precise types (sums) as a tool for achieving the most. Runtime FSM looks like overcomplicating the problem.

Thread Thread
 
davidkpiano profile image
David K. 🎹

That's fine, my goal is to get developers thinking about their apps in terms of finite states and preventing impossible states. It's up to you whether you want to use a runtime FSM or not.