DEV Community

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

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

Let's use baking a cake as an example. You're a cakemaker, it's what you do. You take a recipe, go into a kitchen, and bake a cake.

Every kitchen is somewhat different: not everything is in the same place, nor is everything always in the same place. But it's possible to bake a cake in all of these, as they have:

  • bowls and baking pans
  • a spoon, whisk, spatula
  • measuring cups and spoons
  • an oven
  • a pantry with flour, sugar, baking soda, salt
  • a fridge with some eggs and milk

This is all the stuff you need to bake a basic cake. You won't get anything fancy, but without all of this you won't be able to bake a cake at all. We call this the "standard library" of cake baking: all the essentials to bake cakes.

If you wish to bake a fancier cake, say with a frosting, cherries, and sprinkels, you'll have to use more than the standard. You might get lucky and have them in your current kitchen, but you can't rely on it. You'll have to make a note in your recipe on how to acquire these items, or to check you have the frosting gun before starting.

The fancier the cake the more likely you need ever more special components or equipment. This isn't part of the standard library since not everybody will need it, and a typical kitchne can't fit all the stuff everybody would ever need. So the "standard library" sticks with the basics, giving room to add more as needed.