Clean Code
Glossary
Every Clean Code term in plain words, with the module that teaches it. Inside modules, any word with a dotted underline explains itself.
Clean Code · 35 terms
- AI coding assistant
- A tool built on a language model that suggests or writes code from a description or from the surrounding code. Its output still needs review like any colleague's.
- Learn it in “AI-written code” →
- Architecture decision record (ADR)
- A short document kept with the code that records an important decision: its context, the decision, its status and its consequences.
- Learn it in “Team conventions” →
- Boundary
- The line between your business rules and the outside world (databases, frameworks, vendors), crossed through small interfaces your code owns.
- Learn it in “Boundaries and dependencies” →
- Clean code
- Code that the next person can understand quickly and change safely. Also the title of a well-known 2008 book by Robert C. Martin.
- Learn it in “Code is read more than written” →
- Code smell
- A surface sign in code, such as a very long function or the same switch in several places, that often points to a deeper design problem. A hint, not a rule.
- Learn it in “Code smells” →
- Coding conventions
- A team's agreed habits for writing code, such as naming, layout and structure. Tools enforce what they can; the rest lives in a short style guide.
- Learn it in “Team conventions” →
- Cognitive complexity
- A score designed to track how hard code is to understand, charging extra for nesting. Introduced by SonarSource in 2017.
- Learn it in “Complexity” →
- Cognitive load
- How much a reader has to hold in their head at once to follow the code. Working memory holds only a few chunks, so every extra detail costs.
- Learn it in “Code is read more than written” →
- Cohesion
- How closely the things inside a module belong together. High cohesion means a module is about one thing, so changes to that thing stay inside it.
- Learn it in “Cohesion and coupling” →
- Composition
- Building an object out of smaller objects that each do one job, and combining them, instead of extending a parent class.
- Learn it in “Composition over inheritance” →
- Coupling
- How much one part of the code depends on the details of another. Loose coupling lets each part change without forcing changes elsewhere.
- Learn it in “Cohesion and coupling” →
- Cyclomatic complexity
- A count of the independent paths through a function: its decisions plus one. Proposed by Thomas McCabe in 1976; roughly how many tests it needs.
- Learn it in “Complexity” →
- Doc comment
- A comment attached to a function or class that describes what callers can rely on, such as a Python docstring or a Javadoc block. Tools turn them into reference documentation.
- Learn it in “Comments” →
- Duplication
- The same piece of knowledge, such as a tax rate or a validation rule, written in more than one place, so a change must be made everywhere. DRY (don't repeat yourself) means giving each fact one home.
- Learn it in “Duplication and the wrong abstraction” →
- Error handling
- How code detects, reports and recovers from things going wrong. Clean error handling keeps failures visible and deals with them where something useful can be done.
- Learn it in “Error handling” →
- Fail fast
- Stopping as soon as something is wrong, such as invalid input, so the problem shows up close to its cause instead of causing damage later.
- Learn it in “Error handling” →
- Formatter
- A tool that rewrites code's layout (spacing, line breaks, quotes) to one consistent style without changing what it does, such as Prettier, Black or gofmt.
- Learn it in “Formatting and style” →
- Guard clause
- An early check at the top of a function that handles a special case and returns, so the main logic isn't nested inside conditions.
- Learn it in “Complexity” →
- Inheritance
- Creating a new class by extending an existing one, so it gets the parent's code and can override parts. The child depends on the parent's internals.
- Learn it in “Composition over inheritance” →
- Level of abstraction
- How close code is to the big idea (place an order) versus the low-level detail (loop over bytes). A clear function keeps its steps at one level.
- Learn it in “Functions” →
- Linter
- A tool that reads code and flags patterns that are likely mistakes or confusing, such as unused variables or risky comparisons. ESLint, Ruff and Clippy are linters.
- Learn it in “Formatting and style” →
- Magic number
- A literal value in code, like 3 or 0.9, whose meaning isn't explained. Replacing it with a named constant states the rule.
- Learn it in “Naming” →
- Null
- A special value meaning “nothing here”. In many languages any reference might be null, and using it as if it held a value crashes the program.
- Learn it in “Null and absence” →
- Optional type
- A type that says a value may be missing, such as string | undefined, String? or Option<T>, so the compiler makes you handle the empty case.
- Learn it in “Null and absence” →
- Ports and adapters
- A design where the core application talks to the world through interfaces it owns (ports), and technology-specific code plugs into them (adapters). Also called hexagonal architecture.
- Learn it in “Boundaries and dependencies” →
- Readability
- How easily a person can understand what code does and why, without running it or asking its author.
- Learn it in “Code is read more than written” →
- Refactoring
- Changing the structure of code without changing what it does, in small steps checked by tests, to make it easier to understand and change.
- Learn it in “Refactoring” →
- SOLID
- Five object-oriented design principles: single responsibility, open–closed, Liskov substitution, interface segregation and dependency inversion. Useful guides, not laws.
- Learn it in “SOLID, with its critics” →
- Static analysis
- Examining code without running it, using tools such as linters, type checkers and security scanners, to find bugs, risky patterns and inconsistencies early.
- Learn it in “Static analysis” →
- Technical debt
- The future cost of shortcuts in code: changes get slower until the shortcuts are cleaned up. Coined as a metaphor by Ward Cunningham in 1992.
- Learn it in “Technical debt” →
- Type checker
- A tool or compiler step that checks values are used consistently with their types, such as TypeScript, mypy or pyright, catching whole classes of mistakes before the code runs.
- Learn it in “Static analysis” →
- Types as documentation
- Designing types so they describe exactly which values and states are possible. The compiler then checks the description everywhere, unlike a comment.
- Learn it in “Types as documentation” →
- Union type
- A type that is one of several named alternatives, each with its own data, such as an order that is placed, paid, delivered, cancelled or refunded. Also called a sum type or sealed type.
- Learn it in “Types as documentation” →
- Wrong abstraction
- Shared code built on a bad guess about what is common, which then grows flags and special cases for each caller. Often cheaper to undo than to keep patching.
- Learn it in “Duplication and the wrong abstraction” →
- YAGNI
- “You aren't gonna need it”: don't build features for imagined future needs. It never means skipping tests or refactoring.
- Learn it in “Keep it simple” →
A
B
C
D
E
F
G
I
L
M
N
O
P
R
S
T
U
W
Y
General terms · shared by every track
- ACID
- Four guarantees for transactions: Atomic (all or nothing), Consistent (rules hold), Isolated (concurrent work doesn't interfere), Durable (once done, it stays done).
- Learn it in “ACID on object storage” →
- Atomic
- All or nothing. An atomic change either happens completely or not at all, and nobody ever sees it half done.
- Think of it as: Handing over a sealed envelope: the other person has it or doesn't. There's no half-handed envelope.
- Learn it in “Object storage: the ground floor” →
- Batch processing
- Processing data in scheduled chunks, such as every night or every hour.
- Learn it in “Getting data in” →
- CSV
- Comma-separated values: plain text, one row per line. Easy to read, slow and large for analytics, and no schema.
- Learn it in “Rows vs columns: file formats” →
- Idempotent
- Safe to run twice: running the job again gives the same result instead of duplicating data.
- Learn it in “Medallion architecture” →
- JSON
- A text format of nested key-value objects, like {"id": 7}. Common for app events and APIs, and used by Delta's transaction log.
- Learn it in “Rows vs columns: file formats” →
- Metadata
- Data about data: which files exist, their schema, sizes and statistics. Engines read metadata first to plan work.
- Learn it in “What makes a table a table” →
- Schema
- The structure of a table: its column names and types, such as order_id: long, amount: decimal.
- Learn it in “Schema evolution & enforcement” →
- SQL
- The standard language for querying tables: SELECT … FROM … WHERE …
- Learn it in “Hands-on: query in your browser” →
- Streaming
- Processing data continuously as it arrives, within seconds or minutes.
- Learn it in “Getting data in” →
- Transaction
- A group of changes that succeeds or fails as one unit.
- Think of it as: A money transfer: debit one account and credit the other, or do neither.
- Learn it in “ACID on object storage” →
A
B
C
I
J
M
S
T