16 February 2006 ~ 9 Comments

Why Benji hates frameworks

I’ll admit it. I just don’t “get” the whole web framework thing.

To me (and maybe I’m just a bit dense) it just seems like layer upon layer of abstraction that doesn’t really gain me anything. It’s like, “Don’t learn SQL, it’s too complicated. Instead learn this other language that does the SQL for you and then you never need to actually write SQL yourself!” Yeah, well, I still have to write in some language and now it’s some crazy lang that only five people use.

I exaggerate. But to me, abstraction for abstraction’s sake doesn’t appear to make things easier or save time.

Nate and I were discussing this issue and he pointed out an article at the Joel on Software Discussion Group. Back in September 2005, Benji Smith wrote about web frameworks by analogy in “Why I Hate Frameworks” and it really sums up my thoughts quite well.

Read it. It’s awesome.

Update: Just to sort out some of the confusion about this post… I really do think there are times when a framework can be useful. They aren’t always a bad thing. For example, they can help you keep your M, V, and C separate if you are having trouble doing that youself. But you have to admit, he’s got a point.

9 Responses to “Why Benji hates frameworks”

  1. Nathan 16 February 2006 at 6:15 pm Permalink

    I have to agree…on both counts – the main article and the update. Nothing is worse than having to troubleshoot a framework that you don’t know.

    It’s all well and good to think that a framework will take off and to use it, however after you are gone and the framework is not adopted, I will be the one that has to learn Hibernate so I can figure out WTF the sql is suddenly breaking. Now if I had the query in front of me that is another story (and to be fair, good logging can help here). But I don’t want to learn the flavor framework of the month to fix your bad code. I would rather look at it and see, “Oh yeah, he did a join and in this case it’s not going to get a user if they have an alternate email address”.

    YOU. ARE. NOT. ALONE.

  2. John 16 February 2006 at 6:34 pm Permalink

    Thanks for the support.

    Now get ready for some flames from the TurboGears/Django people.

    j/k :)

  3. Lon 17 February 2006 at 9:10 am Permalink

    Actually, I thought that rant was rather poor. I don’t think he’s in the same Rails world as the rest of us. :) I’m just beginning my Rails journey but even with my limited experience that post had me thinking, “Huh? Is this guy for real?”

    In contrast, here’s a good counterpoint article I saw on digg: http://zifus.blogspot.com/2006/02/regarding-rails-restrictions.html

    BTW, Nate, Rails gives you full control over your queries. Scaffolding should only be used for quick and dirty testing.

  4. Nathan 17 February 2006 at 3:20 pm Permalink

    malaclypse…sure. I don’t intend to throw the baby out with the bathwater. However having just spent the last few months fighting with Java frameworks and thier annoyances, I think what I had to say was valid.

  5. John 18 February 2006 at 3:08 pm Permalink

    Lon:

    Admittedly, the only frameworks I’ve tried were Django and web.py. And both was just in the most trivial of ways, so I’m probably not qualified to critique them much.

    If rails doesn’t overly abstract your queries, that’s a huge plus IMHO.

    Thanks for the comment!

  6. Tom 19 February 2006 at 8:41 pm Permalink

    I think you might be missing the point. We don’t use frameworks because we can’t write SQL. We use frameworks to avoid writing the same code over and over again. How many database layers or templating systems should we have to write?

  7. John 19 February 2006 at 8:49 pm Permalink

    Hi Tom.

    Actually my point relies on the assumption that you do know SQL. That’s why you don’t need to overly abstract it. :)

    That said, I think templating systems are a really good example of your point. That’s something that is necessary for most (all?) web applications, and there’s no need to reinvent the wheel. Good point.

  8. Mark A. Hershberger 3 April 2006 at 1:52 pm Permalink

    I no nothing about Python or Ruby, so I can’t pretend to speak about
    frameworks in those languages.

    However, in the same way that I dislike mixing structure (HTML) with
    presentation (CSS) and logic (Perl, in my case), I hate mixing the
    storage (SQL) with the logic (Perl).

    Sure, I could write classes for it, but why? Someone else has already
    done that. This is why I like Catalyst since I can forget all about
    the rest of the app while working on the storage semantics; I can
    forget about presentation when working on the logic; and I can hand
    presentation off to someone who knows a bit about templating.

    Now, I could mix sql into my code directly but, frankly, I’m
    maintaining code where someone did that (poorly) and I’ve developed
    such an aversion to that, that I can’t stand it.


Leave a Reply