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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s