Code Reviews
Intro to Code Reviews
Code reviews are a crucial part of the software development process that involves examining code to identify bugs, improve quality, and promote best practices.
- My Code Review Journey
Jonathan shares his journey to discovering the value of code reviews. He includes helpful advice for all parties in a code review system: authors, reviewers, and leaders. He covers: • What’s the goal of a code review • How to review another’s code • How to prepare your code to be reviewed by others. • Don’t be a jerk
Guidance for the Code Author
Code authors should strive to write clean, readable, and maintainable code, and provide clear documentation and explanations for their decisions.
- Writing pull requests your coworkers might enjoy reading
A Twitter engineer shares advice for getting people to review your code: discuss code changes beforehand, make them small, and describe them clearly.
- The 10 commandments of navigating code reviews
Angie discusses how code review feedback can often lack thoughtfulness, and how to take it in stride.
Guidance for the Code Reviewer
Code reviewers should approach reviews with a constructive mindset, focusing on providing feedback that is specific, actionable, and respectful. They should also be aware of common biases and blind spots that can affect their evaluations.
- How to Do Code Reviews Like a Human (Part One)
Michael explains what is a code review and why are they hard, and then covers 8 techniques for how to do them well: Let computers do the boring parts; Settle style arguments with a style guide; Start reviewing immediately; Start high level and work your way down; Be generous with code examples; Never say “you”; Frame feedback as requests, not commands; Tie notes to principles, not opinions
- What to look for in a code review
In Google's internal documentation for code reviews, they tell code reviewers to look for: design, functionality, complexity, tests, naming, comments, style, consistency, documentation, every line, context, & good things
- Code Review Best Practices
Kevin covers: • What I look for during a review: architecture / design, style, testing • Review your own code first • How to handle code reviews • On mindset • Addressing suggested changes
- A Guide to Mindful Communication in Code Reviews
Amy offers some tips for both code reviewers and authors on practicing mindful communication to maximize the teaching and learning value of code reviews.
Example Code Review Policies
Example code review policies may include guidelines for the frequency and scope of reviews, the use of automated tools, and the roles and responsibilities of different team members. Policies should be tailored to the needs and culture of the organization.
- GitLab's Code Review Guidelines
Gitlab's code review guidelines for GitLab team members and wider community members to ensure code is effective, understandable, maintainable, and secure.
- Code Review Guidelines
Yelp's code review goals, guidelines and checklists.
- On Code Review
Glen emphasizes that code review should be the top priority for all team members, and offers advice to reviewers and submitters.
Further Reading
- Characteristics of Useful Code Reviews: An Empirical Study at Microsoft
An in-depth, quantitative study on the effectiveness of code reviews.