MDN's description fits every framework on either side of the stack: a library that offers opinions about how software gets built. The conventions are the purpose. A library such as a date formatter sits still until the application calls it; a framework such as React, Angular, Vue or Django calls the application, deciding when a component renders, when a request reaches a view and where the configuration lives. That inversion is what makes a framework productive on day one, because the hundred decisions a project needs have been made, and what makes it costly years later, because the decisions cannot be reversed without migrating away.
On the browser side the four MDN names date from a short period: Ember in 2011, React in 2013, Vue in 2014, Angular in its current form in 2016. They solve one problem, keeping what the user sees in step with the data as it changes, and they solve it with components, small units of markup, style and behaviour that compose into a page. On the server side the frameworks are older and settle a different set of questions: how a URL maps to code, how a database table becomes an object, how a session is kept and how a form is validated. Django, Rails, Spring, Laravel and Express are the usual answers in their languages, and a full-stack developer typically runs one of each.
| Question | Library | Framework |
|---|---|---|
| Who calls whom | The application calls the library | The framework calls the application |
| Structure | None imposed | Files, naming and lifecycle are prescribed |
| Replacing it | Swap one function for another | A rewrite of everything that follows its conventions |
| Examples | A date formatter, an HTTP client, a chart drawer | React, Angular, Vue, Django, Rails, Spring, Laravel |
MDN's own guidance on when to omit one applies: a personal portfolio with a few pages and little interaction does not need a framework or its JavaScript. The decision rule for the rest is interaction and lifespan. A page that changes as the user works, a dashboard, an editor, a shop basket, pays for a front-end framework quickly; a page that is read and left does not. On the server, almost any application that lasts past a prototype benefits from a framework's handling of security, sessions and database access, which are exactly the parts a hand-rolled server gets wrong. The web development courses teach one of the big four after plain JavaScript, and the freeCodeCamp Front End Development Libraries certification is graded on projects built in React.
