Monday, August 13, 2018

The Destructive Power of Conflation

Let's play a game.

Imagine you have two changes that need to be reviewed by another person before they can be integrated into your main code line. These code reviews are done without any context and only against the diff of the proposed change.

Don't worry about whether or not you think this is a good idea. Just set your beliefs on that subject aside and play the game.

The first change is the outcome of running an automated code cleanup on an entire module. The tool does things like normalize tabs and spaces, correct the indentation, convert single-line if statements to multi-line, and add or remove braces on conditional statements according to the preferences of the team.

There will be meany of these changes but they are as safe as things get in this perilous universe of ours.

The second change is a minor change to a small behavior. Say, making a single line of code conditional upon the value of a single, already-extant parameter.

Everyone on the team understands this code and will instantly-recognize what the second change means.

You can run one change-review-merge cycle on both changes or you can do them separately. Consider the consequences.

If you make change #1, alone, what's the cost of the review?

If you make change #2, alone, what's the cost of the review?

Now imagine them both together...hundreds, if not thousands, of innocuous changes with a few  impactful changes mixed in among them. What's the cost of that code review?

ANSWER: ˙ʎlǝʌᴉʇɔǝdsǝɹ ',,ǝʌᴉssɐɯ,, puɐ ',,lɐɯᴉuᴉɯ,, ',,lɐᴉʌᴉɹʇ,,