Code generation and state machines work well together
Automates writing out the state logic
Automates tracking and changing states
Can include automatic exception processing
Allows high level description of states