Skip to main content

Bad Diff vs Good Diff

Here's an example of a diff that contains style changes at the same time as a functional change:

image.png

Good luck finding what changed. Could you approve that code review saying you understand what happened with a straight face? It's a needle in a haystack.

Here's the exact same functional change without the style changes:

image.png

Not only does this make way more sense to look at, but it also ensures that there will be far fewer merge conflicts because your changes only touch one area of the code.