State machines are difficult to program and debug. Almost every consideration about the goto statement applies to the event handling mechanisms that manage state transitions. The event handlers do not share variable scopes, so, like in the case of the goto, the code relies on global variables, or in global session variables, when they are created dynamically. There is no top-level structure in the code to make the main sequence evident. For the maintainer, it is very difficult to know what it is trying to achieve.