How to set up a code review if you are all alone

Code review is good. It helps to improve the quality of the code, improve team collaboration, introduce each developer to the most remote corners of the codebase, which he would not soon get to, doing only the tasks assigned to him. Of all the things that programmers usually do, it is in code reviews that the truth of the saying “One head is good, but two is better” is best seen.

But what about a programmer working alone? After all, he has only one head, unless of course he is a mutant. And it is with this head that the developer writes code, which would be nice to review later. How to review your own code if you yourself are its author, and you simply cannot physically look at it through the eyes of another person? It would seem that in this case it is impossible to perform a code review, this is an unsolvable problem, a dead end!

But there is a way out! Thanks to scientific research, we know that we have two relatively independent hemispheres of the brain, each of which looks at the world with its own separate eye: the right eye is connected to the left hemisphere, and the left eye to the right.

Let’s use this gift of nature for a code review! Since when writing programs we turn on our brain as a whole, both of its hemispheres work in conjunction, and represent a fundamentally different system than each half of the brain separately. Thus, if you manage to see your code from the point of view of only one of the hemispheres, it will be, albeit rough, but analogous to an independent code analysis by another developer. And for this it is enough to apply a simple Soviet …

… apply a simple Soviet bandage. Or something else with which you can close one eye – while the other, along with the brain hemisphere “connected” to it, analyzes the code.

Further more! As you know, halves of the brain have a specialization: the left hemisphere is responsible for logic, the right – for creativity, intuition, and aesthetic perception. Therefore, code review with the right eye engages the left brain, and should be a better aid in finding inconsistencies in the logic of the code. A left-eye review will reveal aesthetic flaws in the code, such as style consistency and architectural elegance.

Of course, you need to analyze your code not immediately after writing it, but after taking a break, abstracting from the code, taking a break from programming, unwinding and entering a different mood. You can further contribute to distraction, for example, by playing sports, watching a movie or series, reading a book – which will even better help you look at your code through the eyes of another subject.

After a break and the measures taken to change consciousness, you can proceed to the code review. It is better to do this in rounds: first, the code review is carried out with one eye, then with the other. As with a regular review, the problems found should be immediately recorded in the form of comments to the code.

After the review, it is necessary to pause again and start correcting the shortcomings found in the code – now, as they say, looking at both. If there are controversial and debatable ones among the comments to the code, then, of course, we answer them: at the next round of code reviews, the hemispheres of the brain that wrote them will see answers to their comments, and, perhaps, even object to something. After several such rounds, there are usually no questions left for the code, and the code review can be considered completed.

Of course, you should write comments as politely and correctly as possible, because you don’t want to quarrel with yourself! And do not overdo it with a split personality and a change in consciousness, so that psychiatrists do not have even more reasons to joke about crazy IT people.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *