# Clean Code

> Code that is easy for someone else to read and change.

**Field:** Software Development  
**Category:** Programming Concepts  
**Also known as:** Readable Code, Clean Coding

## Think of it like

Think of it like a tidy kitchen. Anyone can walk in, find the knives and start cooking.

## Definition

Clean code is code that is easy for another person to read, understand and change. It uses clear names, short functions that each do one thing, and no clever tricks. It reads almost like plain sentences. Comments explain why, not what, because the code itself says what. The idea was made famous by Robert C. Martin's 2008 book of the same name.

## Example

Emma renames a function from proc2 to sendInvoiceEmail and splits it into three short ones. Her teammate fixes a bug in it the next day in five minutes.

## Why it matters

Code is read many more times than it is written. Clean code saves hours for every person who reads it later.

## Common mistake

Writing clever one-liners to look smart. The next reader, often you in six months, has to puzzle them out.

## Three principles

- **Clear names.** Say what it does.
- **Small pieces.** One job each.
- **No clever tricks.** Plain beats smart.

## Related terms

- [Refactoring](https://learn.benibix.com/term/development/refactoring)
- [Code Smell](https://learn.benibix.com/term/development/code-smell)
- [Naming Convention](https://learn.benibix.com/term/development/naming-convention)
- [Don't Repeat Yourself (DRY)](https://learn.benibix.com/term/development/dry-principle)

## Told apart from

- [Clean Code vs Style Guide](https://learn.benibix.com/compare/clean-code-vs-style-guide): Clean code and a style guide both make code easier to read, but at different depths. A style guide covers how code looks: spaces, quotes, line length and the shape of names. Clean code covers what it says: clear names, small functions and no tricks. A formatter can fix style for you, but only a person can make code clean.

## Taught in

- [Clean Code and Naming](https://learn.benibix.com/learn/development-concepts/clean-code-and-naming): Programming Basics, 17/18

---

Source: https://learn.benibix.com/term/development/clean-code
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
