What is Framework?
A structured foundation that calls your code, dictating application architecture in exchange for handling the plumbing.
Definition
The distinction from a library is inversion of control: you call a library, but a framework calls you. A framework supplies the application skeleton—routing, lifecycle, build pipeline, conventions for where files live—and invokes your code at defined extension points. That trade buys enormous leverage (Next.js, Django, Rails, and Spring each eliminate weeks of setup) at the cost of working within the framework's assumptions; fighting them is usually more expensive than switching. Frameworks tend to be opinionated by design, since the shared conventions are what make code portable between teams and projects. Choosing one is a long-lived architectural commitment, so ecosystem health and maintenance track record matter as much as features.

