News for hackers. Stuff that matters.
Re:Why Developers Never Use State Machines (2011) by gopalv on Tuesday February 27, 2018 @01:08AM (#16471422)
> Traditional programming languages and imperative thinking don't lend themselves to writing state machines

That's probably not the problem - imperative development can start off from a level of complexity where state machines don't look relevant.

Six weeks down the line, the whole codebase has overtaken the complexity of a state machine, though each of the development bugs were simple fixes to the original branching code.

The standard web-app wizard is where I've run into this again and again.

Every web-app is stateful enough to maintain DB state sync'd & ticking over from a user-click, which makes it really easy to work out whether all clicks go somewhere useful.

However this makes sense only when you have around 7+ states and transitions between them (particularly the "go back" one).

Until then, the regular if/else branch scenarios work out just fine ... but then when you're near the 20-30 state range, it all falls apart.

Re:Why Developers Never Use State Machines (2011) by xyhopguy on Tuesday February 27, 2018 @06:59AM (#16472696)
> (particularly the "go back" one).

Holy shit, once I built a web app for some biologists that wanted a "designer wizard." First I implemented a really shitty buggy wizard. Then I refactored it all into a state machine...........

Re:Why Developers Never Use State Machines (2011) by spdionis on Tuesday February 27, 2018 @09:01AM (#16473365)
That's also why state machines are common in GUI frameworks, as noted by a sibling comment above.