4 ms·
I find myself recreating different versions of state machines for almost all projects I work on. The ability to reduce a problem to a state and reactions to ext
by cwingrav 10y ago
I find myself recreating different versions of state machines for almost all projects I work on. The ability to reduce a problem to a state and reactions to external stimuli, resulting in a new state, is a powerful, simple and easily testable/encompassing process. You can write cohesive and testable pieces of code, and return to them later, and easily understand what you originally wrote. When I start writing callbacks and event-based code, I find myself confused and tracing through a "spaghetti of callbacks".