Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Any enum with clear transition logic is effectively a state machine. However, if you try to implement SMs as separate classes/objects with explicit transition functions, than it does become an unreadable mess. The logic in your code stops representing behavior. I think that's what the grandparent post refers to. Also, "explicit" state machines don't allow to use recursion, which can made code much more readable.


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

Search: