Cover of Practical Statecharts in C/C++

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.

Mentions per year

20 2007: 0 mentions2008: 0 mentions2009: 0 mentions2010: 0 mentions2011: 0 mentions2012: 0 mentions2013: 0 mentions2014: 0 mentions2015: 0 mentions2016: 0 mentions2017: 0 mentions2018: 0 mentions2019: 0 mentions2020: 0 mentions2021: 0 mentions2022: 0 mentions2023: 1 mention2024: 1 mention2025: 2 mentions2026: 0 mentions200720172026

What Hacker News says

  • dogleash · Jan 23, 2023 · Recommends

    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)” ↗
  • turtleyacht · Sep 17, 2024 · Mentions

    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” ↗
  • turtleyacht · Mar 28, 2025 · Mentions

    > 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” ↗
  • adinisom · Jul 13, 2025 · Critical

    …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” ↗

Keyboard shortcuts

/
Focus search
j / k
Next / previous book
Enter
Open focused book
Esc
Close / go back
g h
Go to Home
g t
Go to Top all-time
g m
Go to Most recommended
g r
Go to Rising
g f
Go to For You
?
Show this help