
Practical Statecharts in C/C++
by Miro Samek · first published 2002
4mentions
1recommended by
3HN commenters
2023–2025first – last mentioned
33% recommend33% neutral33% critical
Affiliate links. As an Amazon Associate I earn from qualifying purchases.
Practical Statecharts in C/C++: https://www.amazon.com/Practical-Statecharts-Quantum-Program... Or more generically, look into Hierarchical State Machines. There's a few insights that you can apply to your state machines that will…
on “Why Developers Never Use State Machines (2011)” ↗A (buggy) Windows calculator is also used to demonstrate concepts in Dr. Miro Samek's Practical Statecharts in C/C++ (2002): [pdf] https://www.state-machine.com/doc/PSiCC.pdf
on “Pressing "add" right before "multiply" changes the Windows Calculator results” ↗> OOP without the boilerplate Agreed. Dr. Samek says as much too and presents an object-oriented version of C, C+, in Practical Statecharts in C/C++. Thank-you for your replies. If you happen to see this comment, I wanted to ask about reification. The pattern is the idea, the design reifies--"makes real"--the pattern. Something else--whether code,…
on “Don't Be Afraid of Types” ↗…State transitions are "goto" by another name. State machines have their place but tend to be write-only (hard to read and modify) so are ideally small and few. Worked at a place that drank Miro Samek's "Practical Statecharts in C/C++" kool-aid... caused lots of problems. So instead I use this pattern everywhere that I can linearize control flow. And if I need a state machine with this pattern I can just use goto. Agreed re: making…
on “Hacking Coroutines into C” ↗