When responding to code review comments, responses like “Done,” “Updated,” or “Fixed” are commonly used to indicate addressing a suggestion. However, sometimes, a little extra context adds a lot of clarity.
Next time you resolve a code review comment, ask yourself: "Is how I addressed the comment completely obvious from the code change and comment thread?" If not, supplement your response with a brief note to clarify the “why” or “how.” Your reviewers will thank you.
When is it helpful to add context to a code review comment response? Here are a few examples:
Reviewer: | This approach seems risky. It might not handle all the edge cases properly. |
| Less helpful response: | More helpful response: |
Author: | Updated. | Good catch. I've added checks for null, empty, and negative inputs, each with a new test case. Thanks! |
Reviewer: | Consider using a more performant library for this data transformation. |
| Less helpful response: | More helpful response: |
Author: | I’ll go with Y. | Done. I considered Library X, but stuck with Library Y because our datasets here are typically small, so the performance difference is negligible, and Library Y has a much simpler API. |
An offline discussion influenced the solution. Briefly summarizing the outcome or key reasoning from an offline sync ensures that other reviewers, who only see the final code change, can grasp the “why”.
Reviewer: | This logic seems a bit complex. Consider a simpler way to handle these. |
| Less helpful response: | More helpful response: |
Author: | Fixed. | As we discussed offline, this complexity is required to maintain backward compatibility with legacy data formats. I’ve added a comment in the code to clarify this. Thanks! |