What are libraries in programming?

Programming library definition

Libraries in programming languages are collections of prewritten code that users can use to optimize tasks.

Library examples

Here are a few programming library examples you might encounter in Python, JavaScript, and other languages.


Primary Language: Python

Use: NumPy is a library used to make powerful arrays. For machine learning, NumPy divides the data and manipulates it easily.

Meaning, machine learning uses many operations on arrays of data. These data sets often contain thousands of numbers and to iterate through every single value one at a time would be difficult and lengthy. NumPy simplifies all of this!


Primary Language: Python

Use: Going off of the above, Matplotlib is used with NumPy to help with datasets. Specifically, Matplotlib handles large datasets and comes complete with standard graphing functions. It’s also useful for visualizing values over time.

Basically, Matplotlib is great for plotting and works hand-in-hand with NumPy.


Primary Language: Python or C++

Use: TensorFlow is a library developed by Google to facilitate the creation and training of machine learning models and neural networks. It can be used to create and train machine learning models.


Primary Language: Python

Use: Keras is also a library developed to facilitate the creation and training of machine learning models and neural networks. But going off the above, Keras was introduced to simplify TensorFlow. This library can make machine learning significantly easier and it still uses TensorFlow as a backend.


Primary Language: Python

Use: In Python, you can use the Pillow library to create bitmap images.


Primary Language: C++

Use: The Simple and Fast Multimedia Library (SFML) is a library that allows for the creation of images, generation of sound effects, and even connecting of multiple computers!


Primary Language: JavaScript

Use: p5.js is one of the most well-known JavaScript libraries with tons of built-in code.

p5 play

Primary Language: JavaScript

p5.play is a p5 library for easily adding collisions, animations, and various other features dealing with sprites.