You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/7STtgK5QiIc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/7STtgK5QiIc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.
+1 I keep thinking "yeah, this is the stack I will use, let's invest in this" then something new comes along. Not good for those of use affected with "grassisalwaysgreeneritus" :).
You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/7STtgK5QiIc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.
Personally I find that moving state out of components as re-frame's subscriptions and handlers encourage is a desirable trait and would be cautious about reintroducing local state.
Keeping my data in one place (and handling updates and queries through a centralised place) has made it a lot easier for me to manage complex data and logic.
I've played with javelin in the past and it's a fantastic library. I quite like the idea of using it as a replacement for (or perhaps together with?) re-frames subscriptions (so reagents ratoms, really), but in my opinion reliance on local state is a mistake.
Having said that, I'd love to hear counterpoints.
I'm quite interested in the topic of using state machines too. As re-frames readme mentions, app-db updates can be thought of as state transitions, but I think having well defined named states is a good idea as it's very difficult to determine what "state" your application is in by looking at it's data for any non trivial application. I also like the idea of knowing in advance what the valid transitions from any given state are as it's useful for generative testing and debugging and overall understanding of supplication logic.
I'm currently mulling over the idea of combining re-frames app-db with a state machine (perhaps using automat). I feel like maybe a hybrid approach could work well, but an unsure how it would look.
You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/7STtgK5QiIc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.
I would assume you're right that very few are transient. At least with Mikes approach, you can log the error, notify the user and continue working from a clean state (but I assume if the user does the same thing again the error would happen again - that is, they can continue doing "other" things).
The conclusion at the end of his article is very different from the catch-22 suggested to stop people using this at the beginning
Dave
I agree, Colin. I read his conclusion that FSM's are great and not so hard I once you're used to them but that until you're well enough versed they seem too much effort (YAGNI) and when the code is complex enough that it's no longer the case, it's to expensive to change.
I'll definitely check out Ragel.
From my understanding of it:
Use higher level states and decouple them somewhat from the data.
For example, games do have lots of dynamically changing data. In a modern shooter you might have dozens of characters with positions, orientation, velocity, health information, weapons, ammunition, etc all of which can be constantly changing. And that's just taking the characters into account.
I wouldn't go and build a state machine that enumerates all of the possible transitions from a "twelve characters with done distribution of attributes in this location moving in that direction" state. I'd break it down so that each character has a high level state like "seeking powerup" or "running".
Probably not a great example although it does illustrate that you might have a hierarchy of state machines. In the game example, the highest level might be something like "in play" or "paused" and the lowest might be an each characters "firing weapon".
In client side web app, you could say that each configuration of data is a state (the re-frame readme mentions that you could think of the app-db like this), but I think that's too fine grained to be useful.
Instead I'd define higher level states (possibly in a hierarchy). I'd ask myself, regardless of the data available, what are the logical states that a user could be in and for each one, what are the actions that they can perform (and what state does each action transition them to).
This could be as simple as pages and links, but with a rich single page application it's more likely finer grained than that. Maybe what dialogs or widgets are accessible.
Again, you could then layer these into a hierarchy of state machines.
One advantage of this is you always know what a user can do at any given time because you can look at what state they're in.
I think of FSM states as orthogonal to the data, not as the data itself. The states dictate what data is accessible and what can be done to it; the data doesn't dictate what state the application is in.
I suppose terminology gets confusing, but this is the approach I'm toying with. I'll see how that goes :)
But yeah, needs more thinking.
You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/7STtgK5QiIc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.
--
So the various states are encapsulated in a go loop?
I always knew that core.async could be used to model FSM's.
Well, if you can share the code somehow, do so.
--
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.