## glossary
What is Framework?
A framework is a software structure that provides the basic architecture of an application, leaving the developer to fill in only the business-specific parts. It ships with decisions already made: how to organize files, how to handle requests, how to connect to the database, how to validate data.
The trade-off is clear: you give up freedom and gain speed, plus a set of conventions anyone in the community will recognize. A developer who has used Laravel before can navigate an unfamiliar Laravel project in minutes.
Framework or library? Inversion of control
The most precise distinction lies in who calls whom. With a library, your code is in charge and calls the library when it needs it. With a framework, the framework is in charge and calls your code at the points it defined. This principle is known as inversion of control, summarized in the Hollywood Principle: "don’t call us, we’ll call you".
// LIBRARY — your code decides the flow
import { format } from 'date-fns';
const hoje = format(new Date(), 'dd/MM/yyyy');
// FRAMEWORK — you fill in, it executes
export async function getServerSideProps(context) {
// Next.js calls this function at the moment it defined
return { props: { hora: Date.now() } };
}Categories of framework
- Frontend — React, Vue, Angular and Svelte structure the interface into reactive components.
- Full-stack — Next.js, Nuxt, Laravel, Django and Ruby on Rails cover frontend and backend in the same project.
- Backend — Express, NestJS, Spring Boot and FastAPI organize routes, middlewares and data access.
- Mobile — React Native and Flutter allow one codebase for iOS and Android.
- Testing — Jest, Vitest, Playwright and Cypress standardize how tests are written and run.
What to weigh before choosing
Maturity and release frequency indicate whether the project will still be alive three years from now. Community size determines how easy it will be to find answers and to hire. And the learning curve matters: an opinionated framework accelerates junior teams precisely because it decides so much, while a minimalist one gives freedom to those who already know what they want. We go deeper into this comparison in the articles Framework: what it is and how to choose and Types of frameworks.
The cost of adopting a framework
Every framework imposes lock-in. Migrating from one to another is rarely incremental — it usually means a rewrite. On top of that, when you need something the framework did not anticipate, the effort of working around its conventions can outweigh what you saved. That is why it pays to isolate business logic from the framework: domain rules written in plain code survive the next migration.
## faq
Frequently asked questions
What is the difference between a framework and a library?
A library is called by your code when you need it. A framework calls your code, controlling the application’s flow. In practice, a library is a tool you use; a framework is the structure you work inside of.
Is React a framework or a library?
Technically it is a UI library — the official documentation uses that term. In practice, combined with a router, a state manager and a build tool, the ecosystem around it works like a framework. Next.js, in turn, is unmistakably a framework built on top of React.
Do I need to learn a framework to get a job?
For most openings, yes, because companies build on top of them. But fundamentals come first: someone who understands the language and the underlying concepts can pick up any framework in weeks, while someone who only memorized one framework’s syntax gets stuck as soon as the project leaves the expected path.
## read next