Web & APIs

framework

/ FRAYM-wurk /

A framework is a ready-made scaffold for building an app — a structure with the common parts already in place so you don't start from a blank page every time. Tools like React, Django, and Rails hand you a sensible layout, solutions to the boring-but-necessary problems, and a clear spot to plug in the parts that are actually unique to your app.

Here's the twist that defines a framework: it calls your code, not the other way round. With a plain library, you're in charge — you reach for a tool when you need it. With a framework, the framework runs the show and calls your functions at the right moments ('a request just came in — here, you handle it'). This is sometimes called 'inversion of control', and it's the whole bargain: you give up some freedom over the structure, and in return you skip a huge amount of plumbing.

The payoff is speed and shared ground. You're not reinventing routing, forms, or page rendering — the framework already did that. And because thousands of others use the same one, there's a deep well of guides, fixes, and ready-made pieces to draw from. The cost is that you build things the framework's way; learning a framework is partly learning its opinions.

// You write a handler; the framework calls it for you
app.get("/hello", function (req, res) {
  res.send("Hi!");
});
// You never call this — the framework does, when a request arrives.

You fill in the blanks; the framework decides when to run them.

A library you call; a framework calls you. That's the practical difference.

Also called
web frameworkReactDjangoRails