Library or Framework

GvR quoted Neil Schemenauer on Library or Framework:

A framework is just an application with a lot of hooks; you can design a framework in an entirely ad-hoc fashion by starting with an app that does one thing and trying to generalize in various directions. You can stop at almost any moment and call it "a framework". But a good library requires much more -- there, you need to start with requirements, abstractions and attempt at a minimal API that addresses the maximal set of requirements. Frameworks have no requirement to be minimal in size while maximal in features.

Good summary, though a bit dumbed down on framework -- probably due to the mess of Python web framework at the moment. I don't think it involves less work to get a framework right -- in fact I think it requires much more.

It is a bit like comparing top-down and bottom-up designs. You either start from a big picture and makes your details generic enough to fit all situations (and then call it a "framework"), or start from tight and fast code pieces and build the final application by gluing everything together (and then call all the nuts and bolts "library"). Which one is better? Or rather, both are required to make today's sophisticated software to work.

I was in fact hoping to have the ultimate framework and the ultimate library -- and I am just required to write 3 lines of code in between to produce any piece of software. I wish :)