With an asterisk (*), I will mark topics that are supplementary—this won’t necessarily indicate increased difficulty, but rather additions to current topics, slightly deeper exploration, etc.

Okay, let’s say we’ve developed what we believe is a universal shopping algorithm. We called it “buy” and described the actions needed to buy “what to buy” at the store “where to buy,” having the required amount of money on hand.

Initially, we started from an algorithm for buying kefir to transition to a more abstract version of the algorithm.

But what happens if we ask someone to buy a ton of cement? Will the person cope with this task by following our algorithm? Or what if we ask them to buy a car at a dealership?

In the first case, it turns out that the person cannot physically bring a ton of cement home, meaning the algorithm for buying kefir and bread won’t work. This is what a leaky abstraction is. While developing the algorithm, we inadvertently operated within a specific context without even realizing its existence.

To pick up a car from the dealership after paying for it, you need to have a driver’s license and know how to drive. Once again, our abstraction has leaked.

You can come up with many such examples: all purchases are light individually, but collectively, the person won’t have enough hands to carry them, or their total mass will exceed their physical capacity. Or a single purchase is light but too bulky, so it won’t fit in the elevator, and the person will have to take the stairs, etc.

Vocabulary

  • Universal algorithm

  • Abstraction / Abstract

  • Leaky abstraction