Skip to content

Latest commit

 

History

History
147 lines (77 loc) · 6.85 KB

clkao19w5000h09l5971t8mwg.md

File metadata and controls

147 lines (77 loc) · 6.85 KB
title seoTitle seoDescription datePublished cuid slug cover tags
Software Libraries: What, Why &How
Software libraries
How libraries are created
Thu Jul 20 2023 04:42:04 GMT+0000 (Coordinated Universal Time)
clkao19w5000h09l5971t8mwg
software-libraries-what-why-how
software, library, modules, reactjs, python-libraries

Overview

If you're familiar with writing code in any of the programming languages then you will come across the word library once in a while and they are super easy to use by just importing with one line of code. As we even deep dive there is something called a framework that kicks you with confusion. People always face some sort of uncertainty while experiencing it.

But I promise you don't worry if you have a good idea about both of these or not in this article I will help you. So without further due let's start.

![Let'S Get Started GIF - Despicable Me Minions Lets Get Started - Discover & Share GIFs](https://media.tenor.com/r3XdvPsAV3kAAAAC/despicable-me-minions.gif align="left")

No Doubt ❌

Some people use these two terms interchange but it's quite wrong because let's think there is a twin in the family even though they look the same should we call both of them by the same name? No right!

The same applies here to people who are the inventors of libraries & frameworks using 2 different names to distinguish means they are different for sure.

This confusion rises mainly because of some weird behaviour of a few libraries & frameworks where they violate some conventional rules & regulations.

But Library != Framework

What is library

The technical definition ->"It is a set of code that was previously written that can be called upon when building your code".

But it was as simple as it was you will get more clarity through visualization. Just stick with me throughout the blog.

Imagine there is a problem 😥

![Spongebob Rainbow Gif - IceGif](https://www.icegif.com/wp-content/uploads/spongebob-rainbow-icegif.gif align="left")

Jack has a piece of code that he has to write in different projects so often and he was just really frustrated by the writing code again and again and wanted a solution for this.

One of his friends suggested, "separately writing that repeated code in one single file (module) and importing it whenever you want will save time, it even makes the entire more readable".

Steps

  1. create a separate file & dump the code

    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1689158989918/129f13bf-e320-486a-8566-a58c6b242aa8.png align="center")

    The above is the customized wish with the user's name from the hashnode website.

  2. save the file/module with the respected extension(.py as it was Python)

    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1689159073711/e98fdf41-40ee-42dc-a769-0a2afbadd16d.png align="center")

  3. import and use

    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1689159144283/05979a48-2177-49e8-a0c3-84af9ea99ac7.png align="center")

  4. Output

    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1689159183864/bdd1dc24-b60e-448c-83c2-dde4dea33d89.png align="center")

That's as simple as it was.

In this way, only all the inbuilt modules, packages and libraries work. As the structure grows the name also changes.

structure something look like this👇

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1689159708637/0ffa6591-856a-409d-a549-c01663ae9844.png align="center")

Till now we explored the most basic and fundamental part of the library from now on words let's understand the main aim of our blog.

The above picture is pretty self-explanatory we just wrap up the similar kind of modules into a single name as a package and all the similar kinds of packages into a single library.

Numpy library

Let's understand the Numpy which is a commonly used Machine Learning library that supports large matrices and multi-dimensional data.

In simple words, we can say that it is a collection of similar packages/modules which performs complex algorithmic operations, and scientific computations, which are more specific to machine learning.

Like this, every library has a specific area to focus on and make a difference. A few most famous Python libraries are listed below.

Pandas - used in Data Science

Matplotlib - Responsible for plotting numerical data

Tensor flow - Used for high-level computation

This way these days every problem has a respected solution library to ease the time of the developer.

So far we learned what is a library let's understand why those many libraries and still every single day developers are designing their own libraries.

Why?

In his previous problem with Jack, he saved time and increased the readability of his code just by creating a single module.

  1. Don't repeat yourself

    This is one of the essential software principles & the main aim of using libraries is also this.

  2. Reusability

    One of the main benefits & reasons why libraries exist.

  3. Time-saving

    It's easy to import that library module rather than write something required from scratch.

  4. Readability

    It also makes our code looks clean.

  5. Increases the Execution speed

    Rather than writing the code directly just by instructing we are simply importing which in turn saves a lot of time.

In addition to this there an uncountable benefits why libraries and this is also the reason for a new library every single day.

How

This is the last section of the blog where I just give an intro regarding how to use the libraries.

![Cute Shy GIFs | Tenor](https://media.tenor.com/rPAM20SrLsAAAAAM/picoozi-cute-cat.gif align="left")

It was so simple just using the general keyword "import". Even nowadays every library provides compatibility with another library & all we need to know is how to use it.

The library is not like magic that can generate suddenly instead it is a combination of small things (packages/modules) which are designed to fulfil certain tasks. The below diagram makes things even simple.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1689332783050/474529b2-d5f2-4224-9b3d-0f3029196fea.png align="center")

With this, I am wrapping up the library blog 😊. I just explain everything from scratch hope you understand the scene behind every library and learned something new.

Wind-up

If you like the blog and want content like this please follow the DevinTech community and be involved in our amazing community we are thrilled to be a part of your journey.

Discord -DevsInTech

Twitter - DevsInTech

If you want to make the connection with the writer of the content here you GO.

Twitter - Malavi Pande