Skip to content

First-blood duels to unblock code reviews?

Posted in Stuff

First-blood duels? How dare you! Wait, hear me out. This morning upon waking up, I had a random thought about pull requests. Generally, these are meant to validate the quality of a piece of code before it enters the codebase in a definitive manner. If you have coding standards, you will most likely use these to have a review as neutral as possible. You find something going against your agreed standards, you make note of it and maybe reference the breached standard. Working that way avoids most code review conflicts.

Another rule I tend to have outside of agreed standards is checking if the new piece of code is test-covered or contains an obvious bug. This feels like a reasonable basis for code that doesn’t result in slow code reviews. Actually, such behaviour tends to accelerate reviews and allows pull requests to be merged fairly fast.

Unfortunately, you may be liberal about having coding standards and this is where things turn grey. Leaving grey areas in something that requires a certain amount of rigour tends to make things complicated. Not necessarily due to the complexity of the piece of code to review but more due to the complexity of people.

Nowadays or maybe since the dawn of times, a lot of people feel unseen or unimportant if they don’t contribute to something they witness. This feeling can lead to counter-productive behaviours at times like blocking a pull request to change a variable name. I’m not talking about people naming a variable “x” which gives no clue as to what we’d use the variable for. I am talking about a reasonably named variable. Not necessarily perfect but it explains well enough its purpose.

Now, imagine yourself in the boots of that blocker. Would you make that blocking stand if it means the reviewee might cut you? Would that stance be worth some of your blood or theirs? Maybe upon that consideration, you would think that renaming a “ticksCount” variable to “ticksIncrement” is not worth the trouble? Maybe you will spend more time looking for actual bugs or a more digestible change.

Since changing code is expensive, I do think triggering the change for the wrong reasons should cost too. While bringing back first-blood duels for code reviews might seem excessive it feels like we could all benefit from thinking about it. How lean and deliberate our code review comments be if made with the certainty they’re absolutely necessary? How much time would we save if one could punish wastes of time with a legal threat of violence? Also, how much fitter would software engineers become should they have to sword fight to settle code review disputes.

While excessive at a first glance, bringing back first-blood duels feels like it could benefit our world a great deal. Not just in software but in general. Say people taking offence at a joke you made online. Would they be so brave as to demand from your company to fire you if they had to fight you to the first blood to get their way? Yes, sure, maybe someone would bulk up and learn how to master the way of the blade to bully people out of their jobs but I doubt it. Why? Because training to be good at something, whether it is software development or sword fighting is pretty hard and generally, these people don’t feel like putting much work into what they do.

What do you think would bringing back first-blood duels to settle disputes be a good thing for our societies? Could this really help to make code reviews more productive? If you don’t like violence, I have this past article with some tips to help code reviews go smoother.

Photo by cottonbro from Pexels

Be First to Comment

    Leave a Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    %d bloggers like this: