Writing Code That Tells a Story
Good code is read more often than it is written. Make it worth reading.
By Codeo
May 10, 2025 · 6 min read · Intermediate
Every time we write code, we're not just giving instructions to a computer. We're communicating with another human — or with our future self.
Great code has a structure, a flow, and a purpose. It tells a story.
1. The Code is Read More Than It's Written
Most of the lifetime cost of software comes from maintenance. That means readability determines everything.
// Code is read more often than it is written.
// Make it easy to read.2. Name Things Well
Names are the chapters of your story. Good names remove confusion.
// Bad
int d;
List<T> list;
boolean f;// Better
int userAge;
List<Order> pendingOrders;
boolean isEligible;A name should answer three questions: what it holds, why it exists, and how it is used. If a name needs a comment to be understood, the name is the thing that needs work.
3. One Thing at a Time
A function that does one thing can be named after that thing. A function that does five things gets a name with "and" in it — that is the smell.
- Extract the steps until each level of the function reads like a sentence.
- Keep the levels of abstraction inside a function consistent.
- Let the call site tell the what, and the body tell the how.
4. Make the Intent Obvious
Comments explain why. Code explains what. When a comment describes what the next line does, delete the comment and fix the line.
// Write code that tells a story
function createClarity() {
return cleanCode +
thoughtfulDesign +
empathy;
}5. Tell a Story, Not a Mystery
Mystery code makes the reader hold everything in their head at once. Story code hands them one idea at a time and trusts them with the rest.
“Write code that tells a story. Write it well. Write it clearly. Write it simply. Write it for others to read.”
— Uncle Bob
6. Final Thoughts
Clean code is not a style guide you obey. It is a kindness you extend to whoever opens the file next — and that person is usually you, six months from now, at midnight.
More from the workshop
Refactoring Without Changing Behavior
Small improvements, every day. Leave the code better than you found it.
Testing is a Gift for the Future
Tests are not a burden, they are a safety net for brave changes.
Sharpening the Tools You Use Every Day
A workshop runs on tools you trust. Spend an afternoon on yours.
