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.
- 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!