What are Libraries, Frameworks and Packages?

Madhuresh Gupta
Quick Code
Published in
3 min readMar 27, 2020

We all have heard of Angular, React, Vue, Node packages and many of you would be even using these on a regular basis.

But often we really don’t have a clear idea as to what these are why do we need in the first place.

So, a library is basically a collection of programs or a bunch of handy code someone’s written for you, which you can use in your programs.
A framework is usually a bunch of libraries, and sometimes (but not always) some external utilities, all geared towards solving a particular task. For example, making a web site (web framework), or displaying a user interface (UI framework), etc.
And a package means some code, that has been isolated from the rest, so that after someone makes their own libraries, frameworks they can bundle it and distribute among others easily.

Summing up, these contain reusable pieces of code which anyone can incorporate in their project so that they don’t end up wasting time in re-inventing the wheel and rather focus on the main objective of our project.

For example, if you are writing a program where you will be working with integers and you will need to perform addition and subtraction many times in your code.

def calc(num1, num2, operand): 
if(operand == '+'):
return (num1 + num2)
else:
return (num1 - num2)

Congrats, you just created a library. Now for rest of the code all you need to do is to call this function everytime you need to perform addition or substraction.

Now question comes how do we find these packages and frameworks for our code? Just like when we need to search for an Android app we go to play store, for an iOS app we have AppStore similarly for managing frameworks and packages we have “Package Managers”.

We have following package managers for common programming languages:

2. Python
pip or the PyPI is the central repository for all python packages. We usually incorporate these packages by using the command “pip install …”.

3. Java
Maven is industry standard when it comes to Java packages. In contrast to this, even Gradle is a package manager which is relatively new but is rapidly gaining popularity.

4. .NET/ C#
NuGet is the package manager for .NET. Microsoft maintains and manages the packages for .NET.

So probably by now you must have had a basic idea on how packages, frameworks work and where are they maintained. Can you think of some idea or a piece of code which can be re-used by other fellow developers?

If yes, then go ahead, write your library or framework and publish it as a package! 😊

Originally published at http://madhureshgupta.home.blog on March 27, 2020.

--

--

Madhuresh Gupta
Quick Code

Follows Microsoft, Tesla Motors, SpaceX, Google, Elon Musk. Aviation Admirer!