Development · English usage comparison

Library vs Framework: English Usage Guide for IT Professionals

The key distinction is control: a library is code you call; a framework calls your code. Libraries solve specific problems you choose to use; frameworks provide a structure that constrains how you build the application. The principle is called "inversion of control".

Side-by-side comparison

Aspect Library Framework
Who controls the flow? You — you call the library Framework — it calls your code
Opinionated? No — use it as you like Yes — dictates structure
Example Lodash, Axios, Moment.js React, Django, Spring, Rails
Replace easily? Usually — swap one library for another Hard — framework shapes the whole app

Example sentences

Library

  • "We use Axios as our HTTP client library — we call it when we need to make requests."
  • "I imported the date library and called its format() function."

Framework

  • "Django is a framework — it dictates how you structure your project, routing, and ORM."
  • "The framework calls your view functions when a matching route is hit."

Exercises: choose the correct English usage

Select the best answer for each question, then check your reasoning.

1. "You call it when you need it; it doesn't control your app's structure." This describes a ___.

2. "The ___ calls your functions — you write hooks to plug in." Which word?

3. Django, Rails, and Spring are ___.

4. Which sentence uses the words correctly?

5. What is "inversion of control"?

Frequently asked questions

What is "inversion of control"?

The framework owns the main event loop and calls your code at the right moments (e.g. when a route is matched, when a component renders). In contrast, you call a library explicitly.

Is React a library or a framework?

React is a library for building UIs. It doesn't provide routing, state management, or build tooling — you compose those from other libraries. Next.js (built on React) is a framework.

What is "opinionated"?

A framework is opinionated when it has strong conventions about how you should structure your project. Rails is highly opinionated; Express is unopinionated (called a "minimalist framework" or micro-framework).