News for hackers. Stuff that matters.
Re:Why Developers Never Use State Machines (2011) by colanderman on Monday February 26, 2018 @11:01PM (#16470999)
> if you need to add a new event, each of the states need to be updated to handle that event

Depends on your formalism. I never use state machines of that form for exactly the reason you say. Rather, each state defines the conditions which cause a transition from it. Receiving an event in a state in which it is not expected (say, an I/O completion in a state which should not have outstanding I/O) is a straight-up hard error.

Re:Why Developers Never Use State Machines (2011) by cbetti on Tuesday February 27, 2018 @09:05AM (#16473401)
This idea of defining a hard error for a transition which makes no sense is a nice way to deal with the OPs problem. You must still explicitly handle the situation, but it minimizes the "unwind/undo" code.