MVC Sucks
I try not to be too negative or "ranty" on this website. But there’s one programming "pattern" or "architecture" that has never sat well with me: MVC.
In a recent conversation, an email friend of my referred to MVC as a "triangle layer" and the description hit me like a ton of bricks: that’s it! That’s the problem with MVC.
So in my apis card, I wrote: "A good API is a layer. A good layer lets you think about just one thing at a time. …HTTP doesn’t know anything about TCP/IP, which doesn’t know anything about Ethernet."
But MVC, as I’ve seen it implemented (or "cargo culted", really), doesn’t give you separate layers like that. Instead, it gives you this triangle where each thing is circularly dependent on the other.
In fact, in my experience, it just splits deeply coupled stuff into multiple files and directories. And people do this because, "You gotta split it up somehow," right? Gross.
I’ve heard it said that MVC originates from Smalltalk and that if I see it in action there, my third eye will open up and the mysteries of the user interface universe will be laid bare before me. Maybe that’s so. But gosh, I get a lot of "no true Scotsman" vibes from that.
Until then, "MVC", "MVVC", "MVVM", "MVCVM" (I’m not making any of these up) and any other combination of the letters M, V, and C to describe UIs is about as delightful to me as seeing "XxxxxManager" and "XxxxxxFactory" in a codebase.