These are chat archives for jdubray/sam

16th
Dec 2016
Jean-Jacques Dubray
@jdubray
Dec 16 2016 05:14
And here is a boilerplate alexa project: https://github.com/jdubray/sam-samples/tree/master/aws-alexa-boilerplate based on the AWS HelloWorld project
Edward Mulraney
@edmulraney
Dec 16 2016 10:04
what do people think about application state mutation?
Jean-Jacques Dubray
@jdubray
Dec 16 2016 14:33
Most developers believe that an action can put a system in a particular state (fillCup).
devin ivy
@devinivy
Dec 16 2016 14:39
that becomes a very roundabout way of calling a function directly on app state
Jean-Jacques Dubray
@jdubray
Dec 16 2016 14:44
@devinivy sorry, I am having trouble parsing what you mean. My understanding is that, that's pretty much state of the art, with of course a preference for "pass by value".
devin ivy
@devinivy
Dec 16 2016 15:25
i mean, sometimes i see people using actions as a roundabout way of making a very specific mutation. at which point you might as well have just mutated the model directly. basically: model proposals that are always accepted are almost worse than controllers updating the model directly.
Jean-Jacques Dubray
@jdubray
Dec 16 2016 15:33
I tend to disagree, but I respect the argument.
Edward Mulraney
@edmulraney
Dec 16 2016 15:50
@jdubray fillCup could be presenting a value to the cup model
it would still illustrate the difference between pass by reference/pass by value
i still dont feel that we've clearly defined an action yet and i believe that's because it doesnt fit one definition
Jean-Jacques Dubray
@jdubray
Dec 16 2016 16:10
When you present a value to the model it is irrelevant if that value is passed by reference or by value. Similarly if state representations cannot be computed arbitrarily, it is irrelevant if the model is passed by value/reference. IMHO, that question pushes developers to focus on the wrong problems.
Happy to hear any definition for an action. As I mentioned, I feel the industry would gain a lot by specifying one.
Fred Daoud
@foxdonut
Dec 16 2016 16:16
within SAM, would an action be the act of presenting a proposal to the model?
Jean-Jacques Dubray
@jdubray
Dec 16 2016 16:18
You'd need to define some context, SAM being one possible one. At a minimum, an action would require that we define a "step".
Fred Daoud
@foxdonut
Dec 16 2016 16:18
@devinivy I agree with you on the first part; that sometimes it looks like actions are just model mutations that are always accepted. However, I don't find that worse than controllers updating the model directly. Because, with the latter, I feel like things are out of control, whereas in the former, you still have a precise/controlled place where all model mutations happen, and you can easily start to not accept all proposals at some point.
Jean-Jacques Dubray
@jdubray
Dec 16 2016 16:19
I am in the same camp, I feel that the amount of boilerplate is low compared to the foundation you get when things get more complex over time. Maintainability of the code is definitely increased.
Fred Daoud
@foxdonut
Dec 16 2016 16:19
@jdubray agreed, then within SAM, "action" is one part of a "step", the other parts being the model accepting (or not) the proposal, the state representation, and nap.
yes?
Jean-Jacques Dubray
@jdubray
Dec 16 2016 16:23
I don't disagree of course, but I am open to more minimalist definitions, I don't want to say that SAM is the only possible architecture.
Fred Daoud
@foxdonut
Dec 16 2016 16:23
"step" being somewhat synonymous with the "reactive loop"
Jean-Jacques Dubray
@jdubray
Dec 16 2016 16:24
actually, no, the reactive loop is just one possible implementation of a step.
Fred Daoud
@foxdonut
Dec 16 2016 16:25
That's honourable. You're right, I shouldn't imply that SAM is the only way, nor that reactive loop is the "step".
But things become very clear to me in the context of SAM. I feel in complete control of how data is flowing.
Jean-Jacques Dubray
@jdubray
Dec 16 2016 16:26
It does not mean that a minimalist definition would lead to better implementation, but in this kind of situation is best to adopt a minimalist approach.
The elements would be:
  • action
  • step
  • application state (what I call the model)
Fred Daoud
@foxdonut
Dec 16 2016 16:32
Are there definitions for the relationships between these elements? Such as, action (verb) triggers the beginning of a step? A step is what results in changes in the application state (noun)?
Or is it all open to interpretation?
Jean-Jacques Dubray
@jdubray
Dec 16 2016 16:33
I believe intuitively, there should be one definition, but as I mentioned the problem is that once we start coding, these concepts remain... conceptual, there is no support in any programming language I know, even the most recent ones like Elm.
Edward Mulraney
@edmulraney
Dec 16 2016 16:41
so to clarify - you dont have a definition of action ?
Jean-Jacques Dubray
@jdubray
Dec 16 2016 16:55
I would not say that, I don't want to arbitrarily impose my definition
Edward Mulraney
@edmulraney
Dec 16 2016 16:57
you dont have to - im curious to know what your definition is?
Jean-Jacques Dubray
@jdubray
Dec 16 2016 17:06
As I said before I have to pull the whole SAM pattern in the definition and define an action as a function that translate an intent into a proposal to mutate the property values of the model. I am just questioning if there would not be a more minimalist definition that would still allows SAM to build onto (and align with) but that would enable using that definition in different contexts.
If we use "actions" then everyone ought to be able to define what they mean by "action" and we should understand why there are so many variants of the definition.
Edward Mulraney
@edmulraney
Dec 16 2016 17:08
so by definition, for someone not using the SAM pattern its valid for them to define action as something different
Jean-Jacques Dubray
@jdubray
Dec 16 2016 17:08
nope, we should have a common definition that we can all use in our respective context, SAM being one of them
Wouldn't you agree that's an issue that we cannot converge to a single definition?
Edward Mulraney
@edmulraney
Dec 16 2016 17:11
i think its an issue that you cant offer a definition outside of your SAM ideas
because youre basically saying "your definition is wrong because mine is right"
Jean-Jacques Dubray
@jdubray
Dec 16 2016 17:16
Not sure how you could come on that conclusion, but everyone is entitled to his/her opinion. I am merely pointing out that we have reached a situation where everyone has to come up with their own definition, and I view this as an issue.
Edward Mulraney
@edmulraney
Dec 16 2016 17:36
but you go further than that and have said lee byron etc have got it wrong - but anyway im trying to see if the situation can be improved by seeing if you have a general definition we can start from
Zach Dahl
@schtauffen
Dec 16 2016 18:12
action is too generic of a word to have a specific meaning in all of programming: it will forever and always depend on context
Vincent Jo
@inrix-vincent-jo
Dec 16 2016 21:56
@edmulraney I do not think JJ is saying "your definition is wrong because mine is right".. I think he is just pointing out a problem where actions in different context are not defined so programming gets confusing
I see a lot of problems of semantics even beyond the word of "actions" as well, like "model", "state"... it seems like everyone has their own understanding of it, and I have to try to piece together in my head what they mean..
for example, if a person who is talking to me about Redux mentions state, my brain maps that to "one single global object that UI can pull from"
but in SAM, it is the condition in which the app is in.. so I wholly agree with JJ that we need to start having these semantics level discussions of what these words mean in programming
I think that's what important.. the discussions of what the words mean