DEV Community

Asael Shinder
Asael Shinder

Posted on

Your Pull Request Came Back With Forty Comments

You opened the pull request on Monday, quite pleased with it. On Tuesday morning there are forty comments from the senior engineer on your team. Some are about naming, some about tests, a few are questions, and two or three are long paragraphs that start with I am not sure about this approach. Your stomach drops before you have read a single one properly.

Give yourself a few minutes before you reply to anything. The first reading of a long review is mostly emotional. It feels like a verdict on you, when it is usually a sign that someone took your work seriously enough to read every line.

Then sort the comments before you fix any of them. Make three rough groups. Small things you can just change, like a name or a missing test. Questions where the reviewer wants to understand something. And the few comments about the overall approach. Those last ones matter most, because if the approach changes, half the small fixes may not be needed.

Deal with the big comments first, and consider doing it out loud. A short call to talk through the approach can settle in ten minutes what would take a day of back and forth in writing. Ask what worries them about it, not just what they would change.

Answer the questions honestly. Often a question was asked because the code is not clear. A reply that explains it is good. A clearer name or a short test that explains it is usually better, because the next reader will not see your reply.

Notice patterns. If ten comments are about the same thing, such as error handling, that is one lesson rather than ten problems. Write it down somewhere you will see it next time.

You do not have to accept everything. Where you disagree, say so politely, with your reason, and let the conversation run. That is part of the review too.

When it is merged, thank them, and tell them which comment taught you the most. Long reviews take a lot of time to write. And next time, think about opening a smaller pull request earlier, so the conversation starts before forty comments are needed.

– Asael Shinder

Top comments (0)