5 ms·
I think you're thinking of MVVM, not MVC.
by petilon 4y ago
I think you're thinking of MVVM, not MVC.
- orwin 4y agoWhich honestly was most SaaS products. My first internship was MVVM and killed my motivation to ever do web development. 9 years later my new work involves some react (barely 15% of the job tbh) and I really don't hate it as much.
- phailhaus 4y agoIt's MVC. Having your views driven off models is nice in theory, but a disaster in practice as the number of models proliferates. You lose control over how and when your views render, which results in all sorts of subtle and strange bugs that are difficult to debug. Each view may have its own logic for what to do when the model changes in specific ways, and what controller events to fire in response. Without unidirectional data flow, trying to even reproduce a bug becomes a nightmare.
- petilon 4y agoMVC is unidirectional.
- phailhaus 4y agoNope, not between views. View triggers controller, updates model, triggers some random set of views to update, which triggers controllers, which triggers other models, etc. There is no hierarchy there, nor any batching to avoid rendering inconsistent intermediate state. You have no control of how an update affects your UI. With React, data flows down from the top of the component hierarchy, always. And it doesn't render until all state changes have been made, so you only render after your data has reached consistency.
- petilon 4y agoIncorrect. In fact, you can use React as the 'V' in MVC. That's how it was orignally designed. See here: https://github.com/facebook/react/tree/015833e5942ce55cf31aefd0a5c2be8a65ec2daa https://github.com/facebook/react/tree/015833e5942ce55cf31ae... I am done with this thread.
- davorak 4y agoOne of my complaints about reading computer science and/or programming books in the early 2000(or late 1990s?) was the contradictory definitions of MVC in books I read at the time. I think one book even indicated that MVVM(I think) was often referred to as MVC as an explanation for why this happened. So it understandable people still have conflicting definitions. Here is a random example[1] I pulled up of someone one thinking MVC is not unidirectional but MVVM is. I am not commenting on the correctness of this impression. > MVVM is better than MVC/MVP because of its unidirectional data and dependency flow. Dependency is one way,... [1] https://dev.to/vtsen/mvc-vs-mvp-vs-mvvm-design-patterns-443n#:~:text=MVVM%20is%20better%20than%20MVC,app)%20are%20based%20on%20MVVM https://dev.to/vtsen/mvc-vs-mvp-vs-mvvm-design-patterns-443n....
- deleted 4y ago[deleted]
- phailhaus 4y agoThat's not what we're talking about at all, and you've lost the plot. The reason why React has won out for over a decade is because of the abject failure of MVC to materialize its benefits. It just doesn't scale.
- interlocutor 4y agoWhat about it doesn't scale? Most UI frameworks, including ASP.NET Core, JSP and JSF (Java based frameworks), Ruby on Rails, and Django (Python) are all based on MVC. If MVC doesn't scale the folks who maintain those frameworks would have noticed by now.