Abstractions Should Hide Complexity, Not Shift It

A good abstraction encapsulates difficult details behind a simple, intuitive surface.

🌲 Evergreen·created: ·updated: ·category:design

The fundamental purpose of an abstraction is to reduce the amount of information a developer must hold in their head simultaneously.

In A Philosophy of Software Design, John Ousterhout defines a deep module as one that provides powerful functionality through a simple, minimal interface:

Deep Module:
┌──────────────────────────────┐
│       Simple Interface       │
├──────────────────────────────┤
│                              │
│   Extensive Implementation   │
│       & Hidden Details       │
│                              │
└──────────────────────────────┘

The Failure Mode: Shallow Abstractions

When an abstraction merely renames underlying operations or requires the caller to manage low-level state transitions, it is a shallow abstraction. Shallow abstractions add indirection without reducing cognitive load.

Deep vs. Shallow Abstractions

CharacteristicDeep ModuleShallow Module
Interface SurfaceSmall, simple, intuitiveLarge, verbose, complex
ImplementationExtensive hidden logicThin wrapper, pass-through
Cognitive LoadLow (hides complexity)High (exposes internals)
MaintenanceIsolated changes insideLeaks changes to all callers

Key tenets:

This note is part of the Digital Garden — a collection of connected, evolving thoughts.