Jun 21, 2022
This is the curse of content creation. --Create a simple example that can illustrate your point. State machines are potent ways to abstract complex flows. The benefits are readability and lower code coupling. For example, a new state could be added to the switch by creating the class and modifying the state flow.
You don't need to put every state on the switch class either. You can create a new state in each state (or use a singleton or DI to get an existing state).