|
|
|
|
|
by jonasvp
3034 days ago
|
|
I distinctly remember the first time I looked at a overly long and complicated model class and thought: "OMG, this is a state machine!" - a shortish refactor later and it was much simpler to read and debug. However, now I'm at a loss on how to teach the junior programmers at my company how to recognize which patterns scream "turn me into a state machine!" Several booleans triggering certain code paths in several methods is a pretty sure sign. Are there more? |
|
The words "event loop" probably mean you need a state machine.
If "time" is an input variable, you probably have a state machine.