5 ms·
It seems like there can be some advantages to using the traditional structure. The fsm might be implemented in an object that receives input each time it's call
by yummypaint 6y ago
It seems like there can be some advantages to using the traditional structure. The fsm might be implemented in an object that receives input each time it's called, and is itself embedded in a larger loop. In that case, a goto doesn't make much sense, and storing the state of the machine in anticipation of the next call is what is needed.
The loop based implementation also seems more similar to how one would implement an fsm in a hardware description language. A loop that is visited once per clock cycle seems easier to understand and debug.