Framework vs library vs package vs module: The debate
Hamza Tamenaoul

Hamza Tamenaoul @hamza

About: A software and information systems engineer. Striving every day to give every piece of code the care it deserves.

Location:
France
Joined:
Dec 24, 2017

Framework vs library vs package vs module: The debate

Publish Date: Apr 16 '20
60 7

This article was first published in my blog

As a software developer, this is one of the questions that is often asked, and one of a big source of confusion. In the debate about the difference between frameworks, libraries, packages and modules, what does each one of them represent.

Module

Is the smallest piece of software. A module is a set of methods or functions ready to be used somewhere else.

Package

Is a collection of modules. This may sound funny, but usually what a package does, is gather a number of modules holding in general the same functional purpose. Making it easier to include all the related modules at once.

Library

Well library at it's core, is a collections of packages. It's purpose is to offer a set of functionalities ready to use without worrying about the subsequent packages. So a library is what you include when you want to add some functionality to your code. It does not force any coding style on you either.

Framework

It's a set of libraries. But this time, the framework does not just offer functionalities, but it also provides an architecture for the development work. In other words you don't include a framework. You integrate you code into it. He is the wire frame of the project. That's why a framework forces its coding style on you.

I hope that this quick summary was enjoyable !

Comments 7 total

  • Lenny Adams
    Lenny AdamsApr 22, 2022

    This is a truly helpful explanation! Thank you for taking the time to explain these differences in a clear and concise manner. You've helped me to have a much clearer understanding of how these terminologies actually play out in Software Development. Well done!

  • jassica
    jassica Apr 26, 2022

    thaank u soo much

  • Marsel Khisamutdinov
    Marsel KhisamutdinovJul 13, 2022

    "He is the wire frame of the project."

  • Richard_IT
    Richard_ITSep 2, 2022

    A library is a piece of reusable code that provides some well-tested functionality through a well-defined interface. It can contain one or more modules.
    u forgot add important point i.e Both library and package terms are used interchangeably in JavaScript community.

  • M. Gr.
    M. Gr.Mar 18, 2023

    I heard that many js developers are begging React to be called a library, but comparing to your obvious definitions it should be called a framework even though a smaller one than say angular, because it enforces you to obey its patterns of state handling and re-rendering via state change.
    So what is the benefit of pretending that react is as lightweight as a library?

    • Abdullah Tariq
      Abdullah TariqAug 9, 2023

      In my opinion, the notion of portraying React as lightweight can stem from its modular nature and the fact that we can choose to incorporate only specific aspects of it into projects. This modularity allows to maintain a degree of flexibility and control over the architecture, akin to working with a library.

  • Aimil Arif
    Aimil ArifDec 9, 2024

    thanks a lot for this explanation..

Add comment