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

I definitely use state machines and quite like them. The benefits are real. And they're mostly quite simple.

However, there can also be complexity. Different customers inevitably want different sets of states and different behaviors on transitions. The pre-transition and post-transition logic can get complex. And it can sometimes be difficult in retrospect to figure out what happened if you didn't log and directly relate the transition event to other things (common if you're using a separate generic state machine library). And sometimes you can end up needing overrides to allow a transition from one state to another that isn't normally allowed, in order to fix bad data or mistakes.

But you can control some of that, and the state machine makes a lot of things easier to reason about.



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

Search: