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.
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.