David K 🎹(@DavidKPiano) 's Twitter Profileg
David K 🎹

@DavidKPiano

Making state machines at @statelyai · prev. @Microsoft · I play piano

ID:992126114

linkhttps://stately.ai calendar_today06-12-2012 01:03:35

22,5K Tweets

66,0K Followers

2,6K Following

David K 🎹(@DavidKPiano) 's Twitter Profile Photo

Has learning about state machines influenced the way you develop, whether or not you use them directly in your code?

If so, how? I'd love to know!

account_circle
David K 🎹(@DavidKPiano) 's Twitter Profile Photo

Fun fact: you can write horrendous-looking code in any library or framework, no matter how good/hyped it is.

Don't judge code by what it looks like, but by what it enables and whether the learning curve is worth it for your team & use-cases.

account_circle
𝕮(@chrisshank23) 's Twitter Profile Photo

A misconception I’ve been seeing conflated switch statements as state machines.

Hand-authored switch statements that process events are *not* state machines, they are more or less inverted computational models.

account_circle
Matt Pocock(@mattpocockuk) 's Twitter Profile Photo

type Status = 'loading' | 'success' | 'error';

const [status, setStatus] = useState<Status>('loading');

⬆️ This was such a crazy level-up in my React skills when I learned it.

No more boolean explosion. Every state accounted for.

Just add XState and you're set 😉

account_circle
David K 🎹(@DavidKPiano) 's Twitter Profile Photo

I like this framing of xstate/store:

'Like Redux and Zustand had a baby'

If you like super simple, event-driven state management, give it a try!

account_circle
David K 🎹(@DavidKPiano) 's Twitter Profile Photo

Gonna be honest: for documentation, I just push straight to main. ➡️📚

Removing friction (PRs) makes me more willing to improve and update the docs frequently.

account_circle