3 ms·
The updated design of that state machine looks so bad I stopped reading there. Either the author isn't the best person to be making these arguments or are being
by karmakaze 1y ago
The updated design of that state machine looks so bad I stopped reading there. Either the author isn't the best person to be making these arguments or are being disingenuous to support one.
I do agree with the overall take, "it depends" which is where you end up when you get enough experience and can also be able to articulate when/where and why. As others mention, I find that being able to represent invalid states (and function calls for that matter) in static types is well worth it up to a point.
The other thing I want to say is that you can have a state machine without a thing called a state machine, it's basically what the app is doing regardless so there's really no way of getting away from it, it's a matter of whether you build it with that clarity or not. For the record I prefer implementations that are state machines rather than ones that use an abstraction called a state machine (as the former is a 'zero cognitive-load' abstraction).