These are chat archives for jdubray/sam

28th
Jun 2017
Michael Terry
@formido
Jun 28 2017 01:55
When I've dipped in here periodically, I've seen you mention that the ability to have multiple acceptors should not be compromised
what is an acceptor
I would have thought model.present was the acceptor
and there's only one of those
what's a minimal example of a front end JS app with multiple acceptors
how would that be wired
Jean-Jacques Dubray
@jdubray
Jun 28 2017 02:17
@formido an acceptor is just a unit of work within the present method. It's essential to keep the many-to-many otherwise you'll start to inflate acceptors with otther parts of the model that otherwise would be dealt with an independent acceptor.
Michael Terry
@formido
Jun 28 2017 02:19
So for example a message could match on multiple if blocks within present and that would count?
Jean-Jacques Dubray
@jdubray
Jun 28 2017 02:19
There are many cases when an acceptor would be use to set the view in a particular configuration (I don't want to use the word state), when that configuration can be used fo in different scenarios, then all the config aspects can be in a separate acceptor
yes exactly
Michael Terry
@formido
Jun 28 2017 02:19
alright
I used the SAM pattern to implement an internal status board at work, using reactjs and firebase
Jean-Jacques Dubray
@jdubray
Jun 28 2017 02:20
SAM is really about breaking the controller in building blocks and decentralize the handler into acceptors on the one hand and view components on the other.
Michael Terry
@formido
Jun 28 2017 02:20
I really like the way it's organized
Jean-Jacques Dubray
@jdubray
Jun 28 2017 02:20
cool!
thank you!
Michael Terry
@formido
Jun 28 2017 02:21
it didn't occur to me until just now that you'd probably be interested to hear it
;)
Jean-Jacques Dubray
@jdubray
Jun 28 2017 02:22
always, good or bad, feedback is always good to hear
Michael Terry
@formido
Jun 28 2017 02:22
it's in production and my boss said it's probably the best thing to come out of our department since we've been working together
it's simple but I think SAM was one of the things that made it so very easy to do right
Jean-Jacques Dubray
@jdubray
Jun 28 2017 02:23
I am glad it can help!
I used it in two big projects now, and I feel good about its capablity, as I mentioned I feel the complexity never gets out of hand
it's always easy to reason about changes and additions.
I built a big dashboard recently and it worked like a charm
the speed at which it was built and the stability of the code was just astonishing.
There are 3 back-ends, dozens of APIs feeding the data, a bunch of CRUD too to manage access to clients and groups of users.
Michael Terry
@formido
Jun 28 2017 02:28
yeah, that's my sense
I've been thinking about state complexity ever since I started programming
dwelling on how to manage it
hating OOP
for the first time I feel like there might be a Pareto formula
a reasonable heuristic
Jean-Jacques Dubray
@jdubray
Jun 28 2017 02:29
yes, me too. I spent 20 years trying to find a reasonable way to manage state and at least from my perspective, it meets what I was looking for.
It's also easy to learn
devin ivy
@devinivy
Jun 28 2017 03:43
there are also principles of SAM that are useful enough on their own! the various factorings can be employed separately, or all together for SAM proper.
number one has got to be state and model
Jean-Jacques Dubray
@jdubray
Jun 28 2017 13:03
thank you.
@formido I really wish I knew about this pattern 20 years ago. Many projects I worked on would have had such a different outcome. Even 5 years ago would have been great.
Jean-Jacques Dubray
@jdubray
Jun 28 2017 15:30
Some people have too much time on their hand: https://twitter.com/ladyleet/status/879926623591694336

Problem solved:

we had to do some npm install @types/xyz and then the problem was fixed! @drosenwasser messed around with it yesterday night w me!

Marcus Feitoza
@mfeitoza
Jun 28 2017 16:51
A friend of mine has throwed in a project that use Backbone + React + jQuery + Underscore.js + EJS.
Jean-Jacques Dubray
@jdubray
Jun 28 2017 17:12
I can understand XXX + JQuery because it's going to be a while until we port all the good stuff that was built with it but after that, even underscore, I am always hesitant to add a library for a couple of functions I can write in a few lines of code.
Marcus Feitoza
@mfeitoza
Jun 28 2017 17:52
I can't, the project is using jQuery just for event delegation, the model and B.I. is in Backbone and rendering is backbone > react + ejs.
He showed me some parts of code and is not spaghetti code, but spaghetti with rice, beans and meat.
Jean-Jacques Dubray
@jdubray
Jun 28 2017 18:01
:-)
I bet SAM would make this a tiny bit more organized
Marcus Feitoza
@mfeitoza
Jun 28 2017 18:19
I showed SAM to him, but him is a Junior dev. in the company. Next month we will start develop an app with SAM.
We are tired of this companies of poor coding practices, architecture and design. But if we go in their web sites they look like GODs.
Jean-Jacques Dubray
@jdubray
Jun 28 2017 19:30
ah ah, as I say, the world is built on bullshit (I don't mean it in a negative way). When you think of it progress has always happened pretending something can be done (e.g. I can fly) until one day someone does it. Same applies to I can write good code.
Jean-Jacques Dubray
@jdubray
Jun 28 2017 19:42