News for hackers. Stuff that matters.
Re:Why I No Longer Use MVC Frameworks by userbinator on Tuesday February 16, 2016 @06:31AM (#11109170)
You're right about the complexity, but I never did get the whole "separation of concerns" thing with respect to web applications. Perhaps it makes sense for large applications, but in my experience with smaller, simpler ones, it just means making more little pieces that have to work together correctly for everything to work, and one small change means having to go through several files and make tiny edits in a bunch of places instead of having it all together. IMHO you're separating something that just isn't very suitable to separation.

Generating HTML directly in the code makes it very easy to figure out how everything works, and thus modify it, since you see the whole process in one place.

Speaking as someone who recently turned a ~5kLoC, ostensibly MVC and consisting of over a dozen files (mostly empty or nearly so), but quite trivial application into a single file of less than 100 lines, it's amazing how much complexity some people can introduce.

Re:Why I No Longer Use MVC Frameworks by sreyaNotfilc on Tuesday February 16, 2016 @08:33AM (#11109647)
The problem lies when your application grows. Remember that one of the "rules" in computer science is modularity.

Here's a couple of examples ---------------------------------

For example, lets say you have a data set that returned user information. Combining it directly with the html may be easier. The issue happens when you want to use that same data (or portions of a that data) elsewhere. From there you would have to rewrite the query. Having the data-set separated (either in a class or a function that returns raw data, then having that data parsed and placed within html works much better. There you don't have to rewrite anything (and have the satisfaction that the data "works").

On the other side, separating the html will be helpful as well. Say that the interface has now changed. You are not going to remove a column in a table and reorganize other components. Instead of having to look through the code where you may have placed the html with the data, all you need to do is to make your changes accordingly in your presentation layer.

All in all, it may seem like a lot more work to get things started (I don't use MVC in the traditional sense, and instead have my own programming rig). The reward lies when you can separate duties among team members. Someone can work on the presentation (and the browser compatibility issues that it includes) while another one can work on the business logic. So on and so forth.

Re:Why I No Longer Use MVC Frameworks by marrs on Tuesday February 16, 2016 @09:00AM (#11109797)
So refactor the code when you find yourself needing that separation. You'll find yourself with a much more understandable code base.

You can still have the separation of duties that you describe because, in the case of web app dev, HTML and CSS are already separate languages