What is a development framework?
20th September 2012
My answer to What is a development framework? on Quora
The most useful distinction, in my opinion, is to think about the difference between a framework and a library.
A library is code that you can call from your project—a collection of reusable functions for manipulating PDF files, or classes for making OAuth calls, or resizing images for example. You write your code however you like, then call out to the library functions when you need them.
A framework is also reusable code, but it tends to prescribe how you use it. CodeIgniter for example strongly encourages a specific way of organising your code. In a framework, you often find yourself writing classes or functions that will be called by the framework.
Both have their strengths—libraries are great because you can mix and match them, but frameworks can solve much larger problems (like how to effectively code PHP using the MVC design pattern).
I’ve argued in the past that PHP itself is a development framework... it encourages you to organise your web code in files that map to user-facing URLs, provides a mechanism for accessing $_GET and $_POST data, and includes a huge array of web-development-specific functions baked in to the language. This is in comparison to a general purpose programming language like Ruby or Python which can’t easily be used for web development without the addition of a framework such as Django or Rails.
These are certainly not hard and fast definitions—in fact I don’t think widely agreed dictionary definitions of these terms exist. It’s how I tend to think about them though.
More recent articles
- Weeknotes: Embeddings, more embeddings and Datasette Cloud - 17th September 2023
- Build an image search engine with llm-clip, chat with models with llm chat - 12th September 2023
- LLM now provides tools for working with embeddings - 4th September 2023
- Datasette 1.0a4 and 1.0a5, plus weeknotes - 30th August 2023
- Making Large Language Models work for you - 27th August 2023
- Datasette Cloud, Datasette 1.0a3, llm-mlc and more - 16th August 2023
- How I make annotated presentations - 6th August 2023
- Weeknotes: Plugins for LLM, sqlite-utils and Datasette - 5th August 2023
- Catching up on the weird world of LLMs - 3rd August 2023
- Run Llama 2 on your own Mac using LLM and Homebrew - 1st August 2023