In programming, a libraries are collections of non volatile resources used by programs. These resources may also consist, of configuration data, documentation, pre-written code, subroutines and classes.
Why use Libraries?
- The main reason for using libraries is re-usability. All we need to do is use one function call and a whole task will be performed that would otherwise require code ranging from several to several dozen lines.
- Most libraries contain functions that the ordinary user would not be able to re-create. Without the use of these libraries each user would have to understand the inner workings of each aspect of their respective programming language. Keep in mind that the libraries you use so casually were developed by professionals with years of experience.
- Another obvious benefit is the significant decrease in time required for coding.
Types of Programming Libraries
We’ll be going through a few generic types of Libraries typically found in all languages. This will help you get an idea of the tasks Libraries are created to carry out. We’ll be going through a few generic types of Libraries typically found in all languages. This will help you get an idea of the tasks Libraries are created to carry out.
Keep in mind that there may be several libraries for something, like building GUI. They typically each have their own strengths and weaknesses with varying levels of ease of use, different learning curves and different potentials. With reference to GUI’s, some GUI libraries might be more touch-screen focused, while some are more desktop oriented. It’s up to you to evaluate each library and make your decision based on your needs.
Date and Time: A very simple type of library found in all programming languages. Deals with date and time related tasks such as finding the current date, finding the difference between two dates and more.
OS and System Related: These types of libraries deal with the operating system of the device. They have many functions that give you information regarding the system, file paths, directories and more.
Web-Scraping: Web-scraping is the act of extracting data from the internet. Libraries related to web-scraping help you extract this data in a readable format. Furthermore, they also handle the act of actually connecting to a website securely, terminating the connection when required and more.
GUI development: Once you’ve taken off your training wheels, GUI development is one of the first things you should be learning. Creating a user interface for your application is very important. If you intend on developing software applications, you can’t have your user interacting with the command prompt.
Game Development: A rather niche library type, but important nonetheless. 2-D and 3-D animation, sprite making, world-building and more. Pick your libraries carefully here. Game development libraries are one of the hardest to master, but also reap great rewards.
Web-programming: Another massive field which hosts all kinds of different libraries for various web related activities. Libraries here are usually used for connecting to the internet, socket programming, TCP servers and more.
Standard Libraries
Every programming language has it’s own standard library set. Typically, the most commonly used libraries are included officially within all implementations of a programming language. So much so that the average user considers it as part of the programming language.
Taking Python as reference, where libraries like time, random, socket and math are included within the language when you download it. Unlike non-standard libraries, these do not need to be downloaded and installed separately.
Link to our Python Libraries compilation.
This marks the end of the Programming libraries article. Any suggestions or contributions for CodersLegacy are more than welcome. Questions can be asked in the comments section below.