What's y'all's opinions on MVC?
My background is Clojure and Rust (yeah yeah, make your jokes) and I'm not really into web at all (I see it as a necessary evil).
I think of the view as a pure function of state for the most part. I did some reading and found out that MVC is bloated (controller bloat) and just insufficient for the requirements of modern web applications. Something like TRPC seems pretty cool because it abstracts exactly how my data goes across the wire and what shape it is, I can just call the damn function like everywhere else in programming.
Anyway, it just seems like MVC isn't very good. You really don't need to separate these pieces much anymore.
However, every framework that advertises "batteries included" it seems uses this pattern.
Basically I want to be a one-man team and deploy something without it being horrible. I'm willing to learn any language or paradigm (Go, Elixir, Haskell), as long as the result is correct. (Even if that means learning how to use Effect).
3 Replies
I agree somewhat. Still think it's useful to give structure and encouradge patterns and separation of concerns
I remember coming from an MVC-religious team and joining a startup where most logic was in big functions that did model work, controller work, and view work.
On the one hand it was nice to not follow threads into other folder, but it was a nightware to separate and debug.
So we slowly MVCed it...
The V for View is not longer as relevant tbh (because we pass the data to a template engine which handles the view, the definition here is more obvious today, and you can do controller stuff more easily inside JSX), but the M for Model, and C for controller are very important core patterns (look at backends for frontends, bffs).
Also feels wierd to question a pattern that is literally inside every single piece for modern software from Vue, React to Android, .Net
Overall I think for historic reasons and usefulness in separation of concerns, it's a very important pattern to know.
One key example, if you don't know MVC it will be so much harder to understand why you need virtualised views. Most people need virtualised views and don't know it.
You have to question everything no matter how entrenched. Since I'm new I have the advantage of looking at things with fresh eyes, but of course things become entrenched for reasons. I should understand why and then break the trend when I see fit.
MVC isn't necessarily bloated, that's mostly about the codebase or the framework implementing it. It's a paradigm that can work quite well, but it definitely isn't the most popular in the current JS/TS ecosystem.
You definitely should try a few different conventions or check the code of a few open source projects to get a sense for the different patterns.