Live data from Hacker News

MVC is dead, it's time to MOVE on

cirw.in

161–170 of 233 posts

Re: MVC is dead, it's time to MOVE on

#161
post #43

You know it's nice reading a criticism of something that has an alternative solution offered rather than just going "hey MVC is terrible and you're an idiot for using it". I do however think there's still great benefits to MVC, if you're shovelling code into controllers and can't make it work like it should then MVC is not the right design pattern for the project. Like every other pattern it'll only work when it work…

MVC is terrible for web apps (in the original local GUI domain it's fine for some things), you aren't an idiot for using it because you're probably not actually using it but rather only something loosely inspired by it, and the solution is simply DRY. MVC at its best is simply one manifestation of DRY, but there's no real reason to get too stuck on it when with practice DRY is something you should just always be doin…

> MVC is terrible for web apps

Can you expand more on this? I've used MVC for webapps quite a bit, and find it to work well.

Re: MVC is dead, it's time to MOVE on

#162

Earlier quoted context omitted.

> JSON and RSS are just different methods for representing data to be communicated to other systems. We call those, "views".

In an MVC, the views are used both for output of the model and to map input back to the controllers. Without the input, its not part of the MVC pattern.

I disagree. Yes, MVC provides a pattern that allows views to be input to the user, but if it doesn't make sense for your app, it's perfectly fine to make the view "read-only" and still abide by the spirit of MVC.

If you're claiming that regular HTML views are compliant with MVC because they have HTML links, one can argue that some RSS readers convert the reference links from the RSS feed to actual HTML links that you can use to navigate to the individual RSS item. How is that different than a regular HTML view with links?

Re: MVC is dead, it's time to MOVE on

#163
post #145
post #66

Earlier quoted context omitted.

If "fat controllers go out of control" then you've already made multiple mistakes. I don't think re-inventing the wheel is the right approach to fixing a problem when the developer can understand their own mistakes instead of blaming a framework or architecture. Are you suggesting that OOP breaks the rule of single responsibility? Any 'operation' that modifies the internal data should belong on the model. Would turnL…

Somewhat pedantic, but just throwing this out there: cars, bikes, and boats are all forms of transportation which can turn. They should probably inherit the concept of turning left, and then specify the exact meaning in their context. Obviously, I don't say "turn your handlebars such that the left side is closer to your chest," or "rotate your steering wheel counter-clockwise," when I mean to tell someone to turn lef…

Im having a time parsing what you mean. Are you saying a car should not turn left, and that a controller should turn the wheel left? Please clarify

Re: MVC is dead, it's time to MOVE on

#164
post #54

Does anyone else not really get "MVC"? It seems like every person has their own idea of what it is and no two frameworks can agree on what the necessary parts are. I get the feeling MVC is mostly a bunch of handwaving about separation of concerns, motherhood, and apple pie.

The original MVC architecture was for GUI interfaces in Smalltalk. It was so helpful a design pattern it was borrowed for use in request/response web application, where naturally the use of each part was very different. If you really want to "get" the original MVC, see the classic book "Smalltalk, Objects, and Design" [1] which explains MVC and other OO architectures as well as the principles behind them, which might…

My original implementation of Mvc was writing a game of connect 4 in java. There was a board model. There were two views. One graphical, and one command line. You could update both views by clicking your next move on the graphical board, or putting input on the command line. Once the model was updated, the controller would update any view that was listening on it.

Re: MVC is dead, it's time to MOVE on

#165
post #141

Is there something structured like hacker news that focuses on articles with content like this? I find this a lot more interesting than threads about entrepreneurship but I don't know where to go to read about things like this.

Good question. Architecture doesn't get debated much on the Internet (probably because it's easier to bash PHP), but here's to hoping there is a place where people argue about this more.

The one thing I care about the most is architecture and system design. These conversations are largely absent and developers can go years without acquiring a pallete for this type of discussion. I wish it was discussed more as a lot of the cost of maintenance could be cut down if spaghetti were properly avoided.

Re: MVC is dead, it's time to MOVE on

#166
post #163
post #145

Earlier quoted context omitted.

Somewhat pedantic, but just throwing this out there: cars, bikes, and boats are all forms of transportation which can turn. They should probably inherit the concept of turning left, and then specify the exact meaning in their context. Obviously, I don't say "turn your handlebars such that the left side is closer to your chest," or "rotate your steering wheel counter-clockwise," when I mean to tell someone to turn lef…

Im having a time parsing what you mean. Are you saying a car should not turn left, and that a controller should turn the wheel left? Please clarify

... it was a roundabout way of explaining how right you were, or at least in my initial reading of it.

I see thing which is called a Car, an instance of which is stored in the Model, which may contain other things, including other types of Transports. The user interacts with the View, instructing a left turn - the controller grabs the Car (why it grabs the Car, and not the Bike is undefined =), and tells it to turn left. None of the M, V, or C understand what a left turn is - but the controller knows that the Car can perform such a thing if instructed. The Controller knows it can tell the Car to turn, because the Car is descended from a Transport, and all Transports have a virtual method for turning.

That last sentence was in my head and unfortunately took over my comment.

Re: MVC is dead, it's time to MOVE on

#168
post #96

Earlier quoted context omitted.

JSON and RSS views don't make sense - in MVC, views are visual representations of data (the model). Views are how the user percieves the application. JSON and RSS are just different methods for representing data to be communicated to other systems.

Not saying I disagree with you but then where exactly would the JSON and RSS output methods go in an MVC framework, if not in a view i.e. how would a different system or user consume/access their output? Directly from a controller? Would love to know your thoughts as I've always found MVC a difficult conceptual approach to grok when applying it to web apps (lots of code never seems to have an obvious M, V or C home).

[deleted]

Re: MVC is dead, it's time to MOVE on

#169

You know it's nice reading a criticism of something that has an alternative solution offered rather than just going "hey MVC is terrible and you're an idiot for using it". I do however think there's still great benefits to MVC, if you're shovelling code into controllers and can't make it work like it should then MVC is not the right design pattern for the project. Like every other pattern it'll only work when it work…

I think this article goes even beyond the "is terrible and you're an idiot for using it", it actually "states" MVC is dead. Honestly I'm sick of reading all those "x is dead"-alike articles. Hey, if you believe the web PHP is dead, Java is dead, C is dead.. etc... Technologies, patterns, languages or structures don't die, in fact, if you really fancy you could write your application using C code and compiling it into…

> And I think people tend to be spending too much time thinking why something is imperfect, or how to do it better, instead of actually making stuff that rocks.

I was with you until this. I think it's actually important to think about where flaws are and how improvements could be made.

The literary critic Howard Bloom actually argues that many of the best creative works are agonistic: they take a previous masterpiece and say, "I could do better," and from that claim do. The produced work ends up being a response, saying, "That was good, but here's your mistake, here's how it can be done better, and look how well it turns out."

Re: MVC is dead, it's time to MOVE on

#170

There is no MVC. A design pattern is a reusable solution to problem, given a certain context (set of constraints). My design pattern study group iterated over the Gang of Four book 3 times, please many others. The MVC sessions were the least constructive. No two people could agree on what is and isn't MVC. Or MVP. No, you're not doing it right. Oh, MVC can only be done "correctly" using Smalltalk. Yadda yadda yadda.…

There is MVC. Its just a concept, unlike those design patterns from GoF which are specific.

Models are just data, View are just representations and Controllers are just endpoints. You can program your own way in your language, and if you can categorize your code as such, you can argue it is MVC.

And of course, because its just a concept, anyone in the world can argue why your implementation is not MVC as well.

No, MVC is not the reason to justify Spring, inversion of control, containers, dependency injection, annotation and all other "enterprisey J2EE-esque shovelware" as you mentioned.

MVC has been around since SmallTalk (you know, before even Java...). Heck, you even get MVC in Rails. You see Spring in Rails? Dependency Injections? Annotations? Of course not, since I could not even begin to think they are related.

Post reply on HN