State Machines in Programming
Discussions center on the benefits, underuse, implementation, and libraries for state machines in software development, including comparisons to switch statements and requests for tutorials.
Activity Over Time
Top Contributors
Keywords
Sample Comments
“I don’t need a state machine library” - everyone when starting a new project
State machines are tragically underused IMHO. They are powerful and easy to reason about. I often see a rat's nest of fragile code that could much more easily have been built as a state machine.
State machines are the easy part.
Same here. I am a big proponent of state machines. I have found that state machines bring sanity to an otherwise complex situation. For example, most inexperienced developers will check presence of certain fields to imply where someone is in the process whereas it would be better written using a state machine.
There's obviously no better way to write state machines...
Can anyone recommend a good introduction to using state machines in code? Especially something in javascript/python? I know what an SM is and how it works, I just want to know how to use an SM library to actually do all these cool things.
Is there quick primer on what and why of state machines?
State machines. They can be a helpful abstraction for UI or business logic, and they also make regular expressions make a lot more sense.
if you squint, it all looks like state machines!
I never understood why one needs a framework or a library for state machines. Can't you just write a switch statement.