Tuesday, July 24, 2007

How to effectively abuse code reviews

"No delusion is greater than the notion that method of industry can make up for lack of mother-wit, either in science or practical life. (Thomas Huxley) "

In order to make sure that developers develop buggy code on a constant basis, follow these simple rules:

1. No commit is done without a code review.

2. The responsibility on working code falls on a person who performs the code review.

3. What is being reviewed is the differences between versions.


These steps will bring quick success in the risky business of ruining programmer's productivity, and here's why:

The first rule will ensure that almost always there will be some poor soul looking for a potential reviewer. Chances are that he will pick up someone who is not busy. All worthy developers are busy creating great code, so guess who will be the reviewer? Correct, the weakest developer will do the most code reviews out there.

The second rule will ensure that the poor reviewer will enforce his design and implementation decisions on the original developer. As he is the weakest developer, it may, and eventually will have bad effect on the code quality.


Just to make sure that the poor reviewer will not learn the arcane skill of chasing bugs before they reveal their presence - and ruin by this your dark scheme of sabotaging the code quality - the third rule comes and rips all context out of the review. No chance to perform global refactoring, as the scope is limited. And if out of five places which had to be changed only four were, well - that's great news.


But if your goal is not ruining quality of the code, then maybe the following simple consideration will help.

It is all about getting closer to the ideal of having in the source control repository only the code that serves your goals best. So as long as both persons - the developer and the reviewer - understand these goals, they can proceed to make sure that the goals are met. If necessary, they can review only the differences. Sometimes, a look from a higher level will bring more results. It's all about the attitude.

P.S. Just don't let your goals become your gaol.

No comments: