Create PR before it is too big

Steve Mu
1 min readOct 6, 2021

Benefits of creating smaller PRs: easy to read, get out the unsure part to get reviewed.

Easy to read. Small PR is easier to read. People can review it when they’re taking a break from their PR. I have created a PR that took 4 hours for someone to read, it was reported as painful.

Get new ideas out quicker. Some ideas are controversial or may not be best practice. It saves time to get some code reviewed to make sure other people agree with the new idea before going that road too deep. When I created code with a new pattern that has not been used in codebase before, I would create a PR with some changes to get it reviewed. Maybe I missed something, maybe someone has better ideas. So I would have it reviewed first before writing more code with the new pattern.

How to create small PR and not to to have wait to work on next part

You don’t have to wait your first PR get reviewed before moving to next one. You can create “chaining” PRs. Next can PR just be based off the previous one. Just do git checkout -b next-pr-branch in the first PR branch, this allows you to work on the second PR at the same time the first PR get reviewed.

--

--