Hacker News new | ask | show | jobs
by dragontamer 1910 days ago
I've been dreaming of (ab)using C's "goto" statement to make easy to read finite state machines.

An actual, proper language, for making FSMs probably makes more sense. Lol. But still, the conceptual similarity between a thread-of-execution and FSMs must remain in the back of most programmer's minds. All turing machines are FSMs, and your code determines the state. (When executing "foo" function, you're in the "foo" state. And the "foo" function easily tells you either to return to the previous state, or which states to move forward in).