These are chat archives for jdubray/sam

22nd
Aug 2017
devin ivy
@devinivy
Aug 22 2017 04:10
i saw that. i appreciate that their conclusion had to do with state management, esp mutable vs immutable, but did you otherwise think the article was :thumbsup: ?
Jean-Jacques Dubray
@jdubray
Aug 22 2017 14:04
To be honest, the only thing I like about Angular is that it does not get in the way of SAM, i.e. it's programming model is rather neutral, other than that I hate templates with all my heart and the ceremony introduced by OOP. Take forms for instance, the template/model binding is horrific, it's so much easier to have a general function that extracts form values based on input ids. So for people absolutely wanting to use a framework I would recommend Angular, but I would still recommend not using a framework. I can compare side-by-side now after doing a big Angular project last year and an ES6 this year.
The major issue I have is that React is too reactive. Maybe I don't understand how to control the rendering in React, and perhaps MobX is the solution, but I don't see the light.
Janne Siera
@jannesiera
Aug 22 2017 14:09
What do you mean by 'control the rendering'? What does it mean to be too reactive?
devin ivy
@devinivy
Aug 22 2017 14:12
@jdubray are you familiar with shouldComponentUpdate()?
devin ivy
@devinivy
Aug 22 2017 14:18

it allows you control whether a re-render occurs.

Use shouldComponentUpdate() to let React know if a component's output is not affected by the current change in state or props. The default behavior is to re-render on every state change, and in the vast majority of cases you should rely on the default behavior.

Jean-Jacques Dubray
@jdubray
Aug 22 2017 14:30

that's a horrific coupling a component should not know anything about that. It has to be orchestrated from below.

The default behavior is to re-render on every state change

yes, that's my problem with React

For me the key objective is: decouple the business logic from the view (I call them themes with SAM/ES6) and SAM gives you that. Any framework (or approach using a framework) that cannot achieve that should be discarded. I cannot understand why people would be content to mash up their app logic with a Framework. Haven't they learned anything?
devin ivy
@devinivy
Aug 22 2017 14:33

that's a horrific coupling a component should not know anything about that

the component doesn't have to know about it, just like when we use ReactRedux.connect() we're binding information from the state to the view.

Jean-Jacques Dubray
@jdubray
Aug 22 2017 14:43
ah ok.

there’s a shift in Redux community from Immutable.js to Ramda or lodash/fp

I am so surprised! :-P

then there is this comment:

Actually, how Google Engineers think web development should be is Polymer — not Angular. At Google’s I/0 17 there was maybe 2 Angular talks and about 10+ Polymer talks.

I am not too surprised, Angular does look like it's dying a bit, but at the same time, I feel for a big IT shop building standard IT stuff, that's a stable, robust choice.

devin ivy
@devinivy
Aug 22 2017 14:49
polymer announced today they're moving to use npm and es6 modules (rather than html imports) in the near future.
very interesting!
will be good for the ecosystem, i think.
Jean-Jacques Dubray
@jdubray
Aug 22 2017 14:52
:+1:
I am frameworkless, they make no sense to me, they are built for the sake of it, without ever looking back at the underlying programming model.
Fred Daoud
@foxdonut
Aug 22 2017 15:09
@jdubray I'm pretty sure I've said this before :) you can totally be in control of rendering with React, just don't use state or props, only regular functions to which you pass in your model, and you decide when to render using ReactDOM.render.
Jean-Jacques Dubray
@jdubray
Aug 22 2017 15:10
I see, I am still stuck with the standard React model
devin ivy
@devinivy
Aug 22 2017 15:10
@foxdonut do you know if ReactDOM.render() has overhead?
that, for example, future re-renders would not have.
Fred Daoud
@foxdonut
Aug 22 2017 15:12
@devinivy not that I'm aware of
devin ivy
@devinivy
Aug 22 2017 15:15
that is pretty nice :)