Libraries vs. Frameworks: What’s the Difference?

Sarah Calande
Level Up Coding
Published in
3 min readJan 15, 2019

--

Something I see all the time in the tech world is the interchangeable terminology of libraries vs. frameworks. Even on job applications, I have seen employers call jQuery a framework, when it is in fact a library. So what is the difference?

  • A library is a collection of definitions. It simplifies functions and expressions and condenses many lines of code into single lines, keywords, etc. This is prewritten code, already used by other developers, ready for you to use and make your life easier and your work faster.
  • A framework is a skeleton. It’s like the name says: it’s literally like the framework of a house. The structure is predetermined, and it’s the developer’s job to fill out the gaps with their code.
The framework of a house is similar to a framework such as AngularJS

However, by these definitions, no one can agree on whether or not React.js is a library or framework. Facebook maintains that React is a library, but many think that this is for marketing purposes, as declaring something as a framework can often deter people from trying to learn and implement it. However, based on React’s skeletal structure, many including myself would maintain that it’s definitely a framework. At the same time, it’s not technically necessary to use the entire component structure and pass state and props to make something appear on the page. You could use a few lines of JSX in one file, which makes it seem like nothing but a simple library. It depends how you’re using it, but at it’s most optimal level, React is a framework.

At the end of the day, many maintain that it’s not important to differentiate. However, understanding the differences between libraries and frameworks can solidify your basic knowledge and your overall understanding as a developer. Although technology is always changing and we will have to learn all new libraries/frameworks in the future, it’s important to stay up to date with the greatest understanding of what we’re working with now. Questioning if React is a library or framework can lead you to ask more questions and learn things about it that you otherwise might not have known. Constant questioning and striving for more information is what makes us better developers.

--

--

Full-stack software engineer at Forbes with experience in JavaScript and Ruby. Interested in fitness, nutrition, and learning new languages.