2 ms·
Maybe necessary to define one by the book, but not to put one into code. I've seen enough state machines in the wild that are just a dispatcher with a bunch of
by w4rh4wk5 4y ago
Maybe necessary to define one by the book, but not to put one into code.
I've seen enough state machines in the wild that are just a dispatcher with a bunch of functions mutating a single state variable. Whether we call these contraptions state machines or not is just quibbling.
As others have pointed out, there are better ways to implement them; yet, I rarely come across those.