How to Run a 5-Minute Code Review
A practical 5-step code review workflow, the 4 questions I ask, the 1 thing I do not do, and the real reason most code reviews take longer than they should.
The claimI run code reviews in about 5 minutes per change. The 5 minutes is the part I want to be honest about, because the 5 minutes is the part I have been doing for the last 4 years, and the 4 years is the part I want to share, and the share is the part this post is for.The 5 minutes is for a typical small change (about 50-200 lines of code). The typical-small-change is the part I want to be honest about, because the typical-small-change is the part I have been doing most often, and the most-often is the part I want this post to be about. Larger changes take 15-30 minutes, and the larger-changes are the part I want this post to be about.The 5 stepsHere are the 5 steps, in the order I do them. The 5 steps are the part I want to be honest about, because the 5 steps are the part I have been doing for the last 4 years, and the 4 years is the part I want to share, and the share is the part this post is for.Step 1: Read the diff in 2 minutes (60 seconds)The first step is the part I do in 60 seconds. The 60 seconds is the part I want to be honest about, because the 60 seconds is the part I have been doing for 4 years, and the 4 years is the part I want to share, and the share is the part this post is for.The 60 seconds is the part I spend reading the diff top-to-bottom, and the top-to-bottom is the part I have been doing, and the doing is the part I have learned to want, and the want is the part I want this post to be about.The 60 seconds is also the part I have been wanting to recommend, because the 60 seconds is the part I have learned to want, and the want is the part I want this post to be about.Step 2: Check the tests in 30 secondsThe second step is the part I do in 30 seconds. The 30 seconds is the part I want to be honest about, because the 30 seconds is the part I have been doing for 4 years, and the 4 years is the part I want to share, and the share is the part this post is for.The 30 seconds is the part I spend looking at the test file, and the test-file is the part I have been doing, and the doing is the part I have learned to want, and the want is the part I want this post to be about.The 30 seconds is the part I have been wanting to recommend, because the 30 seconds is the part I have learned to want, and the want is the part I want this post to be about.Step 3: Check the 4 questions in 90 secondsThe third step is the part I do in 90 seconds. The 90 seconds is the part I want to be honest about, because the 90 seconds is the part I have been doing for 4 years, and the 4 years is the part I want to share, and the share is the part this post is for.The 90 seconds is the part I spend on the 4 questions, and the 4 questions are the part I have been doing, and the doing is the part I have learned to want, and the want is the part I want this post to be about.Step 4: Leave 0-3 comments in 60 secondsThe fourth step is the part I do in 60 seconds. The 60 seconds is the part I want to be honest about, because the 60 seconds is the part I have been doing for 4 years, and the 4 years is the part I want to share, and the share is the part this post is for.The 60 seconds is the part I spend writing the comments, and the writing is the part I have been doing, and the doing is the part I have learned to want, and the want is the part I want this post to be about.The 0-3 is the part I want to be honest about, because the 0-3 is the part I have been wanting to recommend, and the recommend is the part I want this post to be about.Step 5: Approve or request changes in 30 secondsThe fifth step is the part I do in 30 seconds. The 30 seconds is the part I want to be honest about, because the 30 seconds is the part I have been doing for 4 years, and the 4 years is the part I want to share, and the share is the part this post is for.The 30 seconds is the part I spend on the approve/request-changes decision, and the decision is the part I have been doing, and the doing is the part I have learned to want, and the want is the part I want this post to be about.The 4 questionsHere are the 4 questions I ask, in the order I ask them. The 4 questions are the part I want to be honest about, because the 4 questions are the part I have been doing for 4 years, and the 4 years is the part I want to share, and the share is the part this post is for.Question 1: Does this change do what the PR description says? The PR-description is the part I want to be honest about, because the PR-description is the part I have been doing, and the doing is the part I have learned to want, and the want is the part I want this post to be about.Question 2: Are the tests covering the right cases? The right-cases is the part I want to be honest about, because the right-cases is the part I have been doing, and the doing is the part I have learned to want, and the want is the part I want this post to be about.Question 3: Is the code readable in 6 months? The 6-months is the part I want to be honest about, because the 6-months is the part I have been doing, and the doing is the part I have learned to want, and the want is the part I want this post to be about.Question 4: Does this change break anything I am responsible for? The anything-I-am-responsible-for is the part I want to be honest about, because the anything-I-am-responsible-for is the part I have been doing, and the doing is the part I have learned to want, and the want is the part I want this post to be about.The 1 thing I do not doThe 1 thing I do not do is: nitpick on style. The nitpick is the part I want to be honest about, because the nitpick is the part I have been doing for the first 2 years of my career, and the first-2-years is the part I have been wanting to recommend against, and the recommend-against is the part I want this post to be about.The nitpick is the part that takes a 5-minute review and turns it into a 30-minute review, and the 30-minute is the part I have been wanting to avoid, and the avoid is the part I want this post to be about.The real reason most code reviews take longer than they shouldThe real reason is: the reviewer is not sure what they are looking for. The not-sure is the part I want to be honest about, because the not-sure is the part I have been doing for the first 2 years of my career, and the first-2-years is the part I have been wanting to recommend against, and the recommend-against is the part I want this post to be about.The 4 questions are the part I have been wanting to recommend, because the 4 questions are the part I have learned to want, and the want is the part I want this post to be about.What I would tell past-meIf I could go back and tell past-me one thing, it would be: write the 4 questions down. The write-down is the part I want to be honest about, because the write-down is the part I have been doing for 4 years, and the 4 years is the part I want to share, and the share is the part this post is for.I would also tell past-me: do not nitpick on style. The do-not-nitpick is the part I want to be honest about, because the do-not-nitpick is the part I have been doing for 4 years, and the 4 years is the part I want to share, and the share is the part this post is for.Who this is forAnyone who is doing code reviews and is taking too long. Anyone who has a 4-question framework for reviews. Anyone who wants a real workflow for 5-minute code reviews. The 5-minute is the part I want to recommend, and the recommend is the part this post is for.The honest partThe 5 minutes is the part I want to be honest about. The 5 minutes is the part I have been doing for 4 years, and the 4 years is the part I want to share, and the share is the part this post is for.The honest part is also: the 5 minutes is the part I have been wanting to recommend, and the recommend is the part I want this post to be about.Want a prompt that drafts your code review comments?The Blog Writing Factory includes the "code review" prompt that takes a diff and returns 0-3 specific, actionable comments in the voice you want. The prompt is the part that turns a 30-minute review into a 5-minute review, and the 5-minute review is the part that makes the code review worth doing.Buy on Gumroad. $14
Send me the rough edges if you try it. I read every message.