Hacker News new | ask | show | jobs
by runawaybottle 1853 days ago
I’ll concede I came with a contentious tone, which is probably resulting in a similar retort by a few of you that is mostly using appeal to authority to justify your claims (eg just learn computer science bro, you must not know it).

Sporadic business logic/spaghetti code is a problem in any application. State machines will not magically avoid this. In fact, it should be just as susceptible to it. When sphagetti code shows up under a complex architecture like this, you could be in a world of hurt. There won’t be a few if-statements for you to unwrap, but instead a maze of cascading state updates. Another common thing I’ve seen is the granularity of capturing any and all state updates, and then some. It’s very tedious.

Anyway, I’ve been dead wrong about 70% of things in life before, so I’d be happy to look at a non trivial app written with xstate if anyone’s got a repo.

1 comments

Sorry if I was flippant. Here is an example of a minute timer app, which replicates Android's timer app behavior using statecharts: https://codesandbox.io/s/xstate-vue-minute-timer-viz-1txmk

Allow popups to see a live visualization of the statechart.