You prepared a code change and asked for a review. A reviewer left a comment you disagree with. Are you going to reply that you will not address the comment?
When addressing comments for your code reviewed by colleagues, find a solution that makes both you and the reviewer happy. The fact that a reviewer left a comment suggests you may be able to improve the code further. Here are two effective ways to respond:
When it’s easy for you to make an improvement, update the code. Improved code benefits future readers and maintainers. You will also avoid a potentially long and emotional debate with a reviewer.
If the comment is unclear, ask the reviewer to explain. To facilitate the process, talk directly with the reviewer through chat, or in person.
Let’s demonstrate with an example code review scenario:
You prepare a code change that modifies the following function:
The code reviewer leaves the following comment:
You disagree with the comment that one additional parameter makes the signature too complex. Nevertheless, do not reject the suggestion outright.
There is another issue that might have prompted the comment: it is not the responsibility of this function to check the post’s language (https://en.wikipedia.org/wiki/Single-responsibility_principle).
You rewrite your code to address the reviewer’s comment: