News for hackers. Stuff that matters.
Re:Co-routines as an alternative to state machines by bkovitz on Saturday August 29, 2009 @11:31PM (#794022)
In my C programming days, I used FSMs heavily. They enabled me to write code to handle extremely tricky, bug-prone problems of various kinds. I wrote them as static data with a tiny interpreter. They took almost no memory, they were super-fast, and they almost always worked the first time. I can't say that FSMs are particularly readable, but they were definitely more readable than tangles of while loops and if statements.

It's always been a disappointment that FSMs work so badly in most high-level languages. They are indeed a good fit to microprocessors.

There are no comments on this comment yet.