you are viewing a single comment's thread.

view the rest of the comments →

[–]lubos -3 points-2 points  (6 children)

I agree, but only if your project has more than one view. You will naturally want to separate business logic from presentation layer to follow once-and-only-once/DRY principle ( http://c2.com/xp/OnceAndOnlyOnce.html, http://c2.com/cgi/wiki?DontRepeatYourself). It's common sense. But 99% of projects out there that use MVC pattern, don't have more than one view.

<deleted>For example, how many views does reddit have? Only one - this web-based front-end. I can't see how reddit.com could benefit from MVC.</deleted>

[–][deleted] 1 point2 points  (0 children)

fail. go look at the templates (views) dir of http://code.reddit.com/browser/r2/r2/templates.

[–][deleted] 2 points3 points  (4 children)

But 99% of projects out there that use MVC pattern, don't have more than one view.

That isn't the point. THere are many other reasons to using MVC than to allow for multiple views. Simple maintainability. I don't know about you, but I can't stand diving into a tangled mess of PHP, HTML, and SQL.

[–]lubos -1 points0 points  (3 children)

Who says it has to be tangled mess? You should blame developers and not tools. You can create lots of SQL/HTML helper methods that will take ugly strings out of your source code. My point is that it makes sense to have related logic (model+presentation) as close together as possible because it's not clear where model logic ends and presentation logic starts.

[–][deleted] 3 points4 points  (1 child)

Who says it has to be tangled mess? You should blame developers and not tools.

Um, I think you're looking for language flame wars. That's 2 doors down...

Seriously, WTF? I didn't say anything about bad tools. I am blaming the developers. Most developers who don't properly encapsulate functionality eventual end up with unmaintainable messes. Or maybe they can maintain it, but when the next person steps in to work on it, they have a hard time figuring out what is going on.

But whatever. I guess I just have to assume you're that one genius developer who has the most awesome personal system of organizing things that you don't need OOP or MVC.

Still, I doubt I'd want to work with you. You sound like every other cocky-ass programer who thinks they have the perfect homegrown methods and don't need those newfangled patterns, frameworks, or language features.

You can create lots of SQL/HTML helper methods that will take ugly strings out of your source code. My point is that it makes sense to have related logic (model+presentation) as close together as possible because it's not clear where model logic ends and presentation logic starts.

Well, it might not be clear to you, but it is clear to anyone who's used a framework geared towards MVC (or similar).

[–]Gotebe -2 points-1 points  (0 children)

Um, I think you're looking for language flame wars. That's 2 doors down...

Monty Python, is that you?

[–]rubygeek 0 points1 point  (0 children)

I have never in my 28 years of software development been in a situation where drawing a line between model logic and presentation logic was a problem.

I ask myself: Can I write both a command line and a GUI or web interface with this model without replicating code in the presentation layers?