2 ms·
It's a Mealy state machine, it should be encoded as a state machine! Why some folks will absolutely insist that a series of manually-written case statements in
by couchand 3y ago
It's a Mealy state machine, it should be encoded as a state machine!
Why some folks will absolutely insist that a series of manually-written case statements in a single thousand line function is the epitome of style, when there's a pure state machine model inside wishing you would free it from the shackles of if else if else if else....
- Turskarama 3y agoI have some experience with state machines, and I absolutely hate them. It's so easy to get lost, you never know where a function will go to next. There's a reason stacks are ubiquitous, they're much easier to fit in your head.
- kaba0 3y agoYou can still have side-effects in your “big” function, based on the return values of pure functions.