Framework vs. Library

Posted 12 years, 3 months ago in Code

Whether you are just joining us in the interactive design field or a long time veteran you've probably heard the terms "library" and "framework" used quite often. I've definitely heard those words thrown around myself, and definitely have contributed a system of each. What I did not know, is that those terms refer to very specific concepts.

Why should I learn the terms?

While it may seem like boring, technical lingo it's important to understand the correct terms so you can communicate with other people more effectively. Had I gone on not knowing there was a difference, I would run the risk of costing myself or my employers time & money. For instance if we were beginning a project and I tell the backend developers to develop a framework when I really needed a library. That's the wrong solution to the problem! That means I will still need a library and the developer just wasted time & company money on building a framework.

What is a framework?

A framework is more of a finished solution to a problem. In other words it's a set of tools and resources to accomplish a specific goal. For instance WordPress can be considered a framework as it's code helps you build a blogging application. With frameworks, you write modules and hooks to interface with the framework. For instance with WordPress you create pages, themes, and hooks to build the website you want. You have set methods for tackling common problems like adding a new post type. So in short a framework is more of a result to a problem.

What is a Library?

A library is more of a set of resources to create a solution. Libraries often contain code that helps you solve other coding tasks. For instance jQuery is a library. It has a function to animate other HTML elements, this of course can be accomplished in native JavaScript, which jQuery is written in, however, jQuery simplifies the task into one function call and one line for the developer. So in short a library is more of a means to an end.

Interestingly, you can use libraries to build a framework, but you can't use frameworks to build a library.