3 ms·
I remember wondering if foregoing the front end frameworks and using a simple state machine - such as the type I remember making for compsci assignments - would
by HumanDrivenDev 9y ago
I remember wondering if foregoing the front end frameworks and using a simple state machine - such as the type I remember making for compsci assignments - would actually make things easier. But then I thought "well I'm new to front end, surely if this was a good solution to the problem everyone would be doing this and there wouldn't be a cambrian framework explosion".
I'd love to hear if others have tried using a state machine.
- lj3 9y agoIf you google "finite state machine javascript", you'll see that lots of people have given it some thought, but it never seems to catch on. My theory is that state machines aren't a natural way to think about most problems nor are they a natural solution to most UI/frontend dev problems. Button states are a natural fit for state machines because they have a finite, well defined and well understood number of states. But, because of that, we already have the equivalent state machine built directly into CSS3 in the form of selectors (:hover, :disabled, :focused, etc).
- skybrian 9y agoI suspect people just write buggy code that ignores corner cases. For example, what should the UI look like if you press a button and the RPC takes a long time or times out? Or suppose an RPC returns really late, when the user went to a different screen, or already started another RPC?