Henning Sato von Rosen
September 17, 2020 at 8:23amHenning Sato von Rosen
September 17, 2020 at 8:23am (Edited 2 years ago)Hi all,
I live in Sweden and study web Design. I'm especially interested in User Interface Construction, especially highly dynamic ones. I have some CS background, but I'm having a very hard time trying to write readable bottom-up code: When more than 20 lines, I'm lost and dismayed and want to start over again trying (doesn't help!). I love Statecharts and my long-term goal is to master them, and use them everywhere where appropriate.
September 17, 2020 at 12:11pm
September 18, 2020 at 6:30am
September 19, 2020 at 3:01am
Hey (rekreanto). So do you already have a solid understanding of JavaScript? I would 1000% recommend that first before you try to master state charts.
I started learning JS 3 years ago and the first 1 or 2 years was hard. 20 lines of code was confusing! But then it ‘clicked’ and everything became better.
So I’m just now at the stage where I am writing state machines using XState but I still come here for a lot of help.
I guess “don’t try to run before you can walk” is my advice. :-)
Actually I have a solid understanding of JavaScript basic features, if you think of the constructs needed for traditional bottom-up (jQuery-style) web programming (so not Promises/async etc). It is the resulting complexity that results that I cannot handle, and hates to produce because I know I will not be able to extend nor change stuff with any kind of confidence later! Like every five lines of code is a messy, bug-ridden hard-to-read fragment of an implicit Statechart :-)
Ah, as good as Statecharts are for the health and sanity of coder and code alike, Xstate is by o means small, and there's a lot to wrap ones head around. Actually, I consider, in order to draw developers into the Statechart world and increase usage also for small stuff, a minimal modular UI library might be nice. Meaning that you could define the UI together with the state functionality, so that you could grasp the whole local UI component at once and very concrete, locally. Obviously there might be downsides and limitations to such an approach. Thoughts on that?
September 20, 2020 at 9:52am
(rekreanto) Check Kingly out: in addition to compiling the state machine library out of the way, and using a professional graph editor, it focuses on UI and is designed for simplicity: https://brucou.github.io/documentation/v1/tutorials/