Your cursor is on a function that looks harmless. It takes a user, a plan and a date. The name says one thing, the tests hint at another, and a two-year-old comment mentions an "enterprise exception" nobody on the team remembers. You haven't typed a line and you're already tired. It's like walking into a meeting room after everyone has left and trying to rebuild the whole argument from what's still on the whiteboard.
Joel Spolsky said it in one line back in 2000: "It's harder to read code than to write it" (Things You Should Never Do, Part I). If reading a codebase drains you, that doesn't make you slow. You're doing the part of the job that eats the most time. Let's walk through why it's hard, why the urge to rewrite is a trap, and a few habits that make reading go faster.
Reading is most of the job
When you write, you start from your own intent. Even on a hard problem, the first shape comes out of your head. When you read, the intent belongs to someone else, often several people across several years. You're reading syntax, plus the deadlines, incidents, naming habits and old constraints that shaped it, most of which nobody wrote down.
That adds up. Xin Xia and colleagues followed 78 professional developers on seven real projects, 3,148 working hours in total, and found they spent about 58% of their time on program comprehension (Measuring Program Comprehension, IEEE TSE 2018). Two more details from that study are worth knowing. Developers often used web browsers and document editors for that work, so a lot of it happened outside the IDE. And senior developers spent a significantly smaller share of their time on comprehension than junior developers. Reading gets faster with practice. It never goes away.
That's why an experienced engineer can look slow in a new codebase, and it has nothing to do with forgetting how to code. A feature might need one file changed, but finding the right file means tracing routes, reading tests, checking migrations, digging through old PRs and asking why a strange branch exists. Nobody sees that work until it stops a wrong edit.
Code hides its history
A conditional looks strange until you learn someone added it after a customer incident. A duplicated helper looks careless until you learn the two flows are drifting apart on purpose. A missing abstraction might be a deliberate choice, because the team tried one before and paid for it. Without the history, every odd line invites judgment. With it, a lot of them turn out to be tradeoffs someone made under deadline pressure.
git blame and the PR it points to are underrated reading tools. Ten minutes in the history of one odd line often tells you more than an hour of staring at it.
Hold off on the rewrite
The biggest temptation in an unfamiliar codebase is to rewrite it. Your own structure is easier for you to read, so a rewrite feels like relief. Spolsky's essay warns about exactly this. He argues that the ugly-looking parts of old code are often bug fixes: one handles an install on a machine without Internet Explorer, another handles low-memory conditions. Throw the code away and the fixes go with it. His main example is Netscape, which decided to rewrite its browser from scratch. He calls that "the single worst strategic mistake" a software company can make, and Netscape went years without code it could ship.
You don't need a company-sized rewrite to fall into this. A branch that looks redundant may serve one old client contract. A clumsy null check may be stopping a bug that only shows up with imported data from one partner. Find out what a strange line is protecting before you delete it.
Pin the behavior with a test first
Tests turn reading into a conversation with evidence. A good test shows what the code promises. When there are no tests, write a characterization test before you change anything. Michael Feathers coined the term in Working Effectively with Legacy Code, and Mark Seemann sums it up well: it describes how the code behaves right now, and that behavior isn't necessarily correct or desirable (Empirical Characterization Testing). Feathers' recipe is almost playful. Put the code in a test harness, write an assertion you know will fail, let the failure show you the real output, then change the test to expect it.
That test won't make bad code good. It gives your next change a floor to stand on, and it records one thing you now understand for whoever reads the code next.
Trace one path, end to end
Trying to understand everything at once is how you end up tired and still lost. Pick one thing: a user action, an API request, an event, a failing test. Follow it all the way through and write down every function, table, queue and service it touches. Mark where the data changes shape, where errors get swallowed, where logs show up or go missing. After one path, you have a route through the forest that you can walk again tomorrow.
Leave more context than you found
Names matter more to readers than to writers. A vague name charges every future reader a small tax. A precise one can replace a paragraph of explanation. Names don't need to be long. They need to carry the distinction the reader cares about: draft or submitted, calculated or stored, display price or billing price, tenant permission or user permission.
Comments work the same way. The useful ones rarely repeat what the code says. They explain why this shape exists, why the obvious alternative didn't work, or which outside constraint the code has to respect. A note like partner import sends empty strings for missing dates can stop someone from "cleaning up" a line that's doing real work. (There's more on that kind of writing in the post on documentation.)
Treat questions as progress, too. When a new teammate asks why a module looks the way it does, answering is a chance to put the context back where everyone can find it. Plenty of codebases are hard to read mostly because the context lives in two or three people's heads.
Try this week
- Pick one request or user action and trace it end to end. Write the path down.
- Before you delete a weird line, run
git blameand read the PR that added it. - Add one characterization test around code you're about to change.
- Rename one thing whose name made you guess.
- Ask one "why is it like this?" in your team channel, and put the answer where the next person will look.