Skip to content

Deep module

A module offering a lot of behaviour behind a small interface, so callers depend on very little of it.

Last reviewed

A deep module hides a lot of behaviour behind a small interface. The measure is the ratio: how much a caller gets against how much a caller has to know. A shallow module is the opposite — a wide interface over almost nothing, so the cost of using it approaches the cost of writing it yourself.

Depth is not the same as size. A large module with fifty exported functions is shallow. A small module with one function that does the whole job is deep.

Also called

deep abstraction

Referenced by

Four read-only tools an agent can call while a reader has the page open, and why there are only four.

Marking a term by hand beats detecting every occurrence of it, and the reverse direction comes free.

Most of what a module will cost you is settled by its interface, before a line of its body is written.

---
title: "Deep module"
description: "A module offering a lot of behaviour behind a small interface, so callers depend on very little of it."
url: "https://lateano.com/glossary/deep-module"
author: "Colin Lateano"
lastReviewed: "2026-06-14"
aliases:
  - "deep abstraction"
tags:
  - title: "How I work"
    url: "https://lateano.com/tags/how-i-work"
  - title: "Things I'm figuring out"
    url: "https://lateano.com/tags/figuring-it-out"
referencingPosts:
  - title: "The tool surface behind this site"
    url: "https://lateano.com/writing/the-tool-surface-behind-this-site"
  - title: "A glossary that links itself"
    url: "https://lateano.com/writing/a-glossary-that-links-itself"
  - title: "The interface is the decision"
    url: "https://lateano.com/writing/the-interface-is-the-decision"
---

# Deep module

A module offering a lot of behaviour behind a small interface, so callers depend on very little of it.

A deep module hides a lot of behaviour behind a small interface. The measure is the ratio: how much a caller gets against how much a caller has to know. A shallow module is the opposite — a wide interface over almost nothing, so the cost of using it approaches the cost of writing it yourself.

Depth is not the same as size. A large module with fifty exported functions is shallow. A small module with one function that does the whole job is deep.