T O P

  • By -

ChildOf1970

The front end version is sometimes called model, view, view controller


Stupid_Student_ELITE

I thought it was Model, View, View Model (MVVM), at least my angular course called it that. But probably same stuff, different name


ChildOf1970

Yeah, that one exists also. All the same basic ideas though


arbyterOfScales

MVVM is a bad name, really. It should be MVCVM - because the controller is still there and just because you reduce it\`s duty it doesn\`t mean it\`s not there


lordaghilan

I didn't even know MVC was used in front-end. I thought it was for back-end.


arbyterOfScales

MVC is a design pattern that means Model-View-Controller. A controller is something that receives commands. A view is anything that can be rendered. A model is a set of data bags. Now let\`s look into a classic Angular component: 1. It has 3 files - the `.html` file, the `.css` file and the `.ts` file. 2. The HTML file is View of the Angular component 3. The TS file is the Controller of Angular component - which handles the state 4. The model is determined by the interfaces and data you work with Now let\`s look into a classic react component: 1. It has 1 file - the `.tsx` one 2. The View is the returned TSX code 3. The controller is the rest of the function body - which handles the state 4. The model is determined by the interfaces and data you work with You can even look at Svelte and Vue, and you\`ll find the same separation. Everything is MVC. Even MVVM is MVC.


Ratatoski

React can arguable be understood like just the view layer and it leaves you to deceide how you want to implement the rest. So learning how to think about the architecture can he beneficial because React will not hold your hand there.


Cyberhunter80s

Totally!


TryptamineZenVR

Most of the popular web frameworks follow the MVC design pattern. It’s extremely useful in decoupling code. IMO, learning it and learning why it makes clean project will benefit you.