February 19, 2022

Patch Size

  —Some experience on code patch size.

I’ve had some funny experiences with a couple of positions I’ve held in relation to developers and their position on the size of commits (patches). For me, code review is one part quality activity and another part knowledge share. I prefer to frame code review as a decision on whether the patch is suitable for use in the product or not.

Most of my career has been spent working on systems software–cryptographic toolkit and then compilers. Several years ago I transitioned to application development–end user applications where the end user is an external party. Two different groups of application developers have made similar arguments against small patches. I’ve never encountered this problem with system developers.

The ask is always: code needs to be reviewed prior to merge to master and your reviewers need to be able to review it throughly. There is always someone who insists that they can’t make small patches and the arguments are always the same:

  • The patch can’t be done differently.
  • The size of the patch doesn’t matter.

The first argument is nonsense, and I attribute it to lazyness in one case and a lack of understanding of the purpose of code review in the second. I direct these people to [kernel.org][https://www.kernel.org] and ask them to tell me what they see. (Those patches are really nice, by the way.)

The second argument is only partially correct. It reflects a lack of empathy towards your reviewers.

Size is a factor when complexity comes into play. It’s a factor because large changes increase the odds of errors being introduced–whitespace changes, where the comittter just couldn’t resist making a simple change or the size of the changes are simply so large that the reviewers give up.

What’s curious the stark contrast between the approach taken by application and system developers. Application developers seem to take more risks in the changes they make and tend to do less automated testing. I don’t have an answer for why, but it’s piqued my interest.

comments powered by Disqus