Sometimes the hardest part of reviewing code is figuring out why the code exists in the first place.
We've all seen pull requests that look perfectly reasonable.
A few files changed.
A couple of functions updated.
Tests passing.
No obvious problems.
You start reviewing, follow the logic, check the edge cases, and eventually reach the end.
But there's one question you still can't answer:
Why was this particular solution chosen?
Not what the code does. That's usually clear enough.
Why this approach?
Why change this behavior now?
What problem was the author actually trying to solve?
And sometimes, the pull request doesn't tell you.
Code explains what. Context explains why.
Imagine a developer changes a function that looks perfectly fine.
The implementation is a little unusual, so you suggest simplifying it.
The author replies:
"We tried that already. It breaks an older integration that isn't covered by our tests."
Suddenly, the original code makes sense.
What looked like unnecessary complexity was actually protecting something important.
The problem wasn't the implementation.
The problem was that the reason behind it existed only in someone's head.
A pull request is also a conversation
I think we sometimes treat code reviews as if they're purely technical inspections.
Does it work?
Is it readable?
Are there edge cases?
Do the tests cover it?
Those questions matter, of course.
But there's another part that's easy to overlook: helping the next person understand the decision.
A short explanation can save more time than another round of refactoring.
Something as simple as:
What problem led to this change?
What alternatives were considered?
Is there any existing behavior that must remain unchanged?
Is there anything unusual that reviewers should know?
Not every pull request needs an essay. Nobody wants to read a novel before approving three lines of CSS.
But a little context can make a surprisingly big difference.
The future reviewer might be you
There's another interesting side to this.
The person reviewing your code today might be you six months later.
You may remember writing the function.
You may even remember the general problem.
But will you remember why you rejected the simpler solution? Or why that seemingly unnecessary condition was important?
Probably not.
And that's when a small explanation becomes surprisingly valuable.
Not because every decision needs permanent documentation, but because some decisions are much harder to reconstruct than the code itself.
A question for developers
What's more frustrating during a code review?
A complicated implementation with a clear explanation.
A simple-looking implementation with almost no context.
A pull request where the code is fine, but the actual problem is unclear.
Personally, I think the second and third can consume far more time than we expect.
What's the one thing you wish every developer included in their pull requests?
I'm curious whether others see code review more as checking code quality or understanding the decisions behind the code.
Top comments (0)