4 ms·
If you can, use state machines, they provide a level of effective encapsulation otherwise hard to beat. This menas ability to change specific behaviours wih ve
by airbreather 7y ago
If you can, use state machines, they provide a level of effective encapsulation otherwise hard to beat.
This menas ability to change specific behaviours wih very limited side effects.
- renox 7y agoIn theory yes, in practice I'm not so sure: I've seen state machine implementations which were ten times more code than the few if/else/for loop needed. Sure you can draw a pretty state machine diagram, but is the code really easier to read and maintain? I'm not sure.