The importance of crafting small pull requests

yevgenp
2 min readFeb 9, 2024

--

I discussed the benefits of small pull requests. If you found the post useful, please consider sharing it with your friends and colleagues. Enjoy!

After writing more than 1000 differentials, I’ve realized I prefer smaller ones. This came from getting lots of feedback and making adjustments over time.

From my experience, I believe all engineers should try to make their differentials smaller when they can. If you haven’t written enough code to see why this matters, let me explain. Here’s why small differentials are better.

  1. Small changes get reviewed more quickly. Once you’re familiar with your codebase, you’ll notice that the delay in getting your code approved isn’t usually about how quickly you write it. It’s often about waiting for others to review it.

People are more inclined to review smaller changes. I even label my shortest changes with “[easy]” in the title to let others know they’re quick to review.

2. Small changes result in fewer bugs. When a change is minimal, it’s easier to understand its impact. This simplifies the testing process, ensuring that the code behaves as intended.

3. Small changes are easier to roll back. When code breaks, a straightforward solution is to revert to a previous version. However, this becomes more complex with larger changes because additional alterations likely build upon it, necessitating their reversal as well.

4. Small changes encounter fewer merge conflicts. Large changes cover more ground and require more time to complete, raising the likelihood of others modifying code while you’re still working on it. Consequently, when you attempt to merge your changes, you’re more likely to encounter conflicts, leading to wasted time and effort.

If you found this helpful, please share it with a friend and consider subscribing if you haven’t already. Thank you!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

yevgenp
yevgenp

Written by yevgenp

Lead Software Engineer | Tech Lead | Software Architect | Senior Software Engineer | IT Career Coach, Mentor & Consultant

No responses yet

Write a response