News for hackers. Stuff that matters.
Re:Things I wish I knew about state management when I starte... by interlocutor on Monday February 10, 2020 @01:24PM (#22291739)
From that Facebook article: Flux eschews MVC in favor of a unidirectional data flow.

This is so incorrect. MVC doesn't imply two-way data binding. The whole Flux architecture was based on a misunderstanding of MVC, and is therefore questionable.

Most UI frameworks, including iOS, ASP.NET Core, JSP and JSF (Java based frameworks), Ruby on Rails, and Django (Python) are all based on MVC.

Why is it that MVC works for all these other frameworks, but doesn't for React? The answer is that MVC does in fact work for React. React itself originally used the tagline "React is the V in MVC". Flux/Redux introduce needless complexity and unnecessary boilerplate. There are MVC libs that make React much easier to use.

Re:Things I wish I knew about state management when I starte... by RookyNumbas on Monday February 10, 2020 @02:16PM (#22292211)
> iOS, ASP.NET Core, JSP and JSF (Java based frameworks), Ruby on Rails, and Django (Python) are all based on MVC.

Don't all of those have two-way data binding?

> Why is it that MVC works for all these other frameworks, but doesn't for React?

I think the point is that Facebook found it doesn't actually work well, at least for their use cases. They found a recurring set of bugs caused by two-way data flow, and built a framework to alleviate it.

Re:Things I wish I knew about state management when I starte... by interlocutor on Monday February 10, 2020 @02:25PM (#22292299)
> Don't all of those have two-way data binding?

No they don't.

> I think the point is that Facebook found it doesn't actually work well, at least for their use cases. They found a recurring set of bugs caused by two-way data flow, and built a framework to alleviate it.

But MVC doesn't mean two-way data flow.