Share this page!
Programmer, author and maintainer of https://t.co/JWAKK9LImm library.
Add to My Authors
20 Mar 19
A thread on
Random ideas around writing an FSM library, with examples from, and motivations behind
, a header-only library created using
*Reuse vs reimplement*
State machines can be deceptively complex, and, unless a trivial one is needed, a reusable framework is highly recommended.
Rolling out one's own for special needs is ok.
Otherwise - pick from a variety of existing solutions from
*Static vs dynamic structure*
The first important decision is whether the structure of FSM could be built/changed at runtime.
The implementation of a dynamic FSM relies on heap-allocated memory, resizable containers and pointers, all of which come at a steep perf price.
Read 22 tweets