2 ms·
Agreed. I've actually been criticized at several positions for a big "manage_transition" function that is basically either chained if statements or a switch.
by taeric 3y ago
Agreed. I've actually been criticized at several positions for a big "manage_transition" function that is basically either chained if statements or a switch. Either is fine as long as you keep it linear and organized. Both can be terrible if you don't do those things. But, most alternatives can get unwieldy for the same reasons.
The worst is when someone refactors it into a "modern" approach and then proceeds to break the general flow of the state machine again and again.