|
|
|
|
|
by dgb23
1153 days ago
|
|
I'm an autodidact and a big fan of state machines (specifically mealy machines). They can easily be expressed as plain data structures of three layers that map the name of a state to possible inputs/events to the appropriate name of the subsequent state. Then you only need code / functions for each transition (from state, to state) to generate effects. This data driven pattern is very straight forward to implement and easy to reason about. I learned it from hobby game programming, especially its application and usefulness. It comes up in lectures/books, sure, but generally people tend to vastly underestimate its applicability and instead smear state control all over their code, regardless of their education. |
|
every example I've seen (probably toy examples from articles) felt like way too much abstraction had been applied over the problem.