4 ms·
…you mean the most common pattern for writing a state machine?
…you mean the most common pattern for writing a state machine?
There's obviously no better way to write state machines...
Can you elaborate?
If they could, they wouldn't have used sarcasm.
Not OP, but in functional languages, state machines are often simply a function (State, Input) -> State
This is a well-discussed issue with c memes, not a widespread issue. Even in c, jump tables are a safer alternative.