Use State Machines!

FSMs are not as complex as you think and they make your code better.

Headshot_large

You might also be interested in these articles...

Richard Clayton

Unrepentant Thoughts on Software and Management.