Why Frameworks Suck

I blogged earlier about Django, a web application framework written in Python. I spent the weekend playing around a little with Django, as I have in the past with Rails and Zope. I always end up having mixed feelings about them: on one hand I can see the power and the potential for increased productivity they offer. On the other, their monolithic nature always puts me off. If I wanted to be an enterprise Java programmer I would be.

So it was interesting to stumble across this blog entry by Andy Smith: Why Frameworks Suck. I have some sympathy with what he says.

6 Responses to “Why Frameworks Suck”

  1. Ivan Uemlianin Says:

    I certainly agree with you both about Zope: I can barely understand what it is, but I’d always assumed that’s because my needs are relatively modest.

    But isn’t a framework just a big library? Even the smallest libraries have expectations about inputs and outputs. What would Zope be like if it were a library instead of a framework?

    As to why [P]istas are particularly prone to writing frameworks, I can only imagine that it’s because [P] scales so well, in terms of both computing power and number of people involved in the project. It’s very easy to start off small and build up as your needs/desires increase to something very large. As long as you refactor as you go, the framework you end up with is as efficient and as fun to hack as the little script you started off with.

    I’m currently in danger of writing a framework or two myself: I’m writing some [P] wrappers for things like HTK (ASR toolkit) and festival (TTS toolkit). Part of the point of writing these wrappers is to allow the users to keep to the file formats and work patterns they’re comfortable with, so framework-type lock-in would obviously be inappropriate. But it also makes sense to have a single wrapper with a clearly defined and documented interface - that sounds like a framework. What should I do?

  2. Darren Brierton Says:

    Ivan, in order to get your post past Apache’s mod_security I had to replace all occurrences of the word “python” with “[P]”.

  3. Darren Brierton Says:

    From your point-of-view, it may not make that much difference whether something is a library or a framework. But suppose I want to use what you’ve written in my own project. Now it becomes difficult, because I have to do things your way. The difference between libraries and frameworks is that a framework is like an application for writng more applications. Libraries are just little chunks of code that provide some functions or objects that you can choose to use or not to use in an application. If I use a framework for writing my web application, then I have to do things the way the framework says I have to. Whereas with libraries I can drop them in or out as I please, and replace one with another.

  4. Ivan Uemlianin Says:

    It sounds like the difference is one of degree. Libraries are only interchangeable if they use the same i/o formats. Some libraries are not just little chunks of code - e.g. the C++ STL. Writing C++ without the STL, you might as well write C.

    This is all nitpicking though. Really, I know a framework when I see one, and my temptation in response is to write the code I need from scratch, which is obviously bad. With things like Zope, can you just pick and choose the bits you want or do you have to swallow the whole thing?

    > From your point-of-view, it may not make that much difference whether something is
    > a library or a framework. But suppose I want to use what you’ve written in my own
    > project. Now it becomes difficult, because I have to do things your way.

    This is a problem from my point of view, because I want the code (e.g. py-fest) to be adopted, and I want happy users. Is it just a matter of getting the requirements right (i.e. of including users in analysis & design), of offering things like config files, or do all apps above a certain complexity necessarily become fascist (like word-processors)?

    I

  5. Darren Brierton Says:

    With Zope, you definitely cannot pick and choose the bits you want. It’s the most monolithic things I’ve ever seen: it includes its own web server, its own object database.

    Rails and Django are better, you can choose which web server and database server you want. But every application you write with them is very much a Rails or a Django app, they’re really not like using a library, like I might use a PHP library for XML-RPC or for RSS. Like you, I know a framework when I see one, but it’s hard to say precisely what the difference is.

    I don’t think it is a matter of complexity. I don’t think an interface alone makes a framework. I’m not sure myself further than that. But have you looked at the Overview and Tutorials on the Django site? I think that gives a very clear indication of why Django is a framework. I guess the question is, is py-fest like that, or more like the way you’d call any other library in Python?

  6. Ivan Uemlianin Says:

    I see what you mean. My things can be used either way: from the command-line as a framework (or just an app) or they can be imported into p***** code as modules/libraries. Phew. They’re also a lot smaller than these big web things.

Leave a Reply


Bad Behavior has blocked 150 access attempts in the last 7 days.

Creative Commons License
This work is licensed under a Creative Commons License.