Hacker News new | past | comments | ask | show | jobs | submit login

I'm not sure about that book however this one: https://www.amazon.com/Practical-UML-Statecharts-Event-Drive...

got on my reading list by virtue of the misfortune of dealing with code written by programmers who adopted the book's approach.

The thesis was that state machines are a powerful formalism that can be fully verified because all the states and edges between them are known. That's half-right: they are powerful because state transitions are essentially "goto" by another name. In practice goto-based programming is brittle to requirement change. The damning part is that state machines don't live in isolation: they interact asynchronously with other state machines and the world at large. The dynamic behavior of these interactions is probably important! and not part of individual state machines. You'd need to co-simulate them.

I feel state machines have their place where no higher-level construct (usually I prefer coroutines) fits the job and it can be kept small and rewritten on requirement change.




That's interesting.. Well I've been thinking of how well would they work along with a rich domain model and high level programming in general.. The book also has a chapter on systems of state machines, one of the suggested approaches was of an hierarchical model in which the lower stms input the higher ones only through their states.. Was the project you talked about embedded sw? BTW UML is also criticized by the book I mentioned, so hopefully it's not the UML trap again :P




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: