Development (General)

Framework vs library: what's the difference?

Frameworks vs libraries: a library is code you call, a framework is code that calls you. Inversion of control, examples, trade-offs and when to use each one.

  • 7 min read
  • 5 questions
  • +35 XP
Transcript

Libraries vs Frameworks, explained by cats. Kitty builds an app. She needs to format dates. Timezones are messy. Days go missing. So Kitty uses a library. Code another cat already wrote. Kitty plugs it in. Problem solved. A library is just a tool.

Kitty uses it when she wants. To save time. Now Kitty tries a framework. A framework is a blueprint. It defines the structure. It has opinions. Where files live. How data flows. How features are built. Kitty still writes the code.

But she follows the framework’s way. Library: is a helpful piece of code Kitty borrows. Framework: provides the plan Kitty builds inside.