DEV Community

Discussion on: Explain Like I'm Five: What's a standard library?

Collapse
 
isaacdlyman profile image
Isaac Lyman • Edited

A standard library is a bunch of functions and types that are pretty much always included with a specific programming language. That is, if you're programming in the language, you can safely expect those things to be available to you.

This is different from actual features of the programming language. Adding numbers together with a plus sign 1 + 1 is not part of the standard library. But if you're programming in Python you'll have access to abs(), a function for getting the absolute value of a number, which is part of the standard library.

What's the difference? Technically abs() is not a unique or essential piece of Python syntax so you could create a Python implementation that doesn't have it. You'd get a bunch of angry programmers in your inbox, but it would still be Python! But if you created a Python implementation without the plus sign + infix operator, it wouldn't be Python at all.

The Python standard library is documented here. The JavaScript standard library, here. You can google "{language} standard library" to find documentation for whatever language you're working in.