[EDIT: Full attribution for the JD Intellectual Property rights]
My coworker Andres, whenever he spots “clever” code during code reviews, asks “What will Joe Developer think of this?”
(Feel free to use Jane Developer if it’s more appropriate.)
Joe Developer is our fictional persona of a capable but not outstanding developer. He knows the popular parts of commonly used APIs, the mainstream parts of the language, but doesn’t know or use quirky constructs or features. He’s probably better at writing code than reading it, and he doesn’t have any particular knowledge of the domain.
You might think we look down on Joe Developer, like he’s not one of us, that he’s not smart. That’s not the case at all – Joe Developer is us.
We have a team of about 10 people and a 3 year old codebase. People have joined and left the team during that time. Even the most senior or most productive people on our team haven’t written more than 20% of the code, and haven’t even seen more than half of it. Some code is new and evolving quickly. Most business reasons behind the code are only documented in our issue tracker and the brains of the people that worked on it.
This means that most of us, most of the time, have to actually read code to understand what it’s doing and how to modify it. Reading new code without the benefit of knowing the domain is hard enough. You have to read, understand, and simulate the execution of the code in order to reason about it. And that’s hard! Brian Kernighan (creator of C and Unix) said:
“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.”
When you’re reading code, you are Joe Developer. Joe reminds us of the difficulty of reading vs writing code, of the power imbalance between the writer and the maintenance programmer a year later. It’s a clever shorthand reminding us to be clear, concise, and as simple as possible in our code. Putting 5% extra attention and rework to accommodate Joe Developer makes reading and revisiting code so much easier. We don’t fix everything, but we remove the most burdensome, most confusing time-sinks, producing an outsized benefit.
We look out for Joe Developer because we are all Joe Developer.
(Andres already wrote about Joe Developer on our company blog)