Skip to content

A list of good practices for giving good reviews in PullRequests

Notifications You must be signed in to change notification settings

pheanex/ReviewGoodPractices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 

Repository files navigation

1. Don’t focus on style

Agree on a consistent style guide and let formatters handle the checking. Style is subjective and offers little value unless it is consistent. By agreeing on a style guide and using formatters for consistency, code reviews can focus on functionality and purpose rather than style.

2. Offer examples

Instead of instructing the author on what to do, provide specific examples or code. Examples help avoid misunderstandings and make it easier to understand, accept, and implement the requested changes.

3. Don’t use ‘you’

Phrase your feedback to minimize the risk of raising your teammate’s defenses. Make it clear that you are critiquing the code, not the coder. Using ‘you’ increases the risk that the recipient will take your criticism personally. Consider using ‘we’ to emphasize shared code ownership.

4. Frame feedback as requests, not commands

Requests make it easier for the author to respond politely. They may have valid reasons for their choices. Framing your feedback as a command can make any pushback seem like disobedience. Framing it as a request or question allows the author to respond more openly.

5. Tie notes to principles, not opinions

Explain both your suggested changes and the reasons behind them. Grounding your notes in principles frames the discussion constructively. Provide supporting evidence, such as links, so the author can learn more about the principle if they are unfamiliar with it.

6. Make the code better, not perfect

While it is tempting to explore every opportunity to improve the code, the author's patience is finite and may wear thin. They could become frustrated if you withhold approval for too long while you keep finding new ways to improve the code. This can slow down the process and may not be the best use of your resources. Focus on the important issues. See Parkinson's law of triviality.

7. Respect the scope

To keep reviews and changes manageable, avoid reviewing code that is outside the scope of the current change. Grant approval as soon as possible. Do not withhold approval for minor changes, and trust that the author will incorporate your feedback if they agree. Avoid being the last gatekeeper who enforces code quality strictly, as there will be times when you cannot be present or others will handle the review.

8. Be inclusive

Use full sentences to express your suggestions and provide necessary details and context. This approach is more respectful and helps others join the discussion easily and understand your arguments better. It also allows them to make informed decisions.

9. Be specific

Instead of requesting open-ended changes like “Add more tests,” specify what exactly can be improved or what is missing, so the author does not have to guess. Ideally, offer examples (see above).

10. Don't nitpick

Invest the author's and reviewers' resources in issues worth solving. This prevents frustration and allows you to deliver value more quickly. If you believe something is worth changing, avoid labeling your feedback as a "nitpick."

11. Switch to Face-to-Face

If there are too many issues or excessive back-and-forth in written communication, switch to face-to-face communication. Cooperation, finding solutions, and reaching common understanding and compromises are usually more efficient this way.

About

A list of good practices for giving good reviews in PullRequests

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published