menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

Statecharts

The Statecharts community on Spectrum is (along with spectrum) MOVING TO OTHER PLATFORMS: For statecharts discussions in general go to Statecharts Discussion on GitHub (link) or Gitter (link). For XState-specific questions, go to the XState discussion forum for Q&A or the Stately discord chat to chat.

Channels
Team

Henning Sato von Rosen

September 17, 2020 at 8:23am

Henning 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
Keep going. I do so for about 16 years in web design :-)
like-fill
1

September 18, 2020 at 6:30am
Thanks! How are you currently using state machines in constructing dynamic pages/UI? How has your relation to/usage of state machines changed over time?

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.
like-fill
1
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.
like-fill
1
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.
like-fill
1
I guess “don’t try to run before you can walk” is my advice. :-)
like-fill
1
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 :-)
Edited
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/
Edited
like-fill
1