I was trying to search who invents this review system but Wikipedia only shows the simple definition and several different methods about it. Maybe, there is no inventor because it just started between programmers naturally. It’s good to read the page if you are not familiar with it. (it’s short) I will quote the definition for a quick explanation.
Code review is systematic examination (often as peer review) of computer source code intended to find and fix mistakes overlooked in the initial development phase, improving both the overall quality of software and the developers’ skills.
My team has a rule about submitting code changes made by all programmers. Before submitting, we should get our code reviewed by other programmers. At least one code review is required. This rule is more strict when we are in Release Candidate cycle. (see this page for software development cycle.) In this phase, we should ask our lead programmer to review code changes as a final review. So, it’s doubling the number of code reviews we need.
Initially, I did NOT like it.
Why? because it made me nervous just like when taking an exam. When I worked in Korea, no one reviewed other programmer’s code. We got tasks (bugs or new requirements) , implemented (or fixed) them, tested the changes a few times and then, just checked in. Done. It was very independent and individual work. No one needed to see other programmer’s changes as long as it worked without a problem. Since I was so used to this system, Code Review was uncomfortable and even I thought it was a sort of blocker to complete my task. For me, it was a test to see if my code is good or bad and like everyone else, I don’t like a test.
However, it did not take long time to realize I was wrong.
Yes, Code Review is a test or a gate you need to pass through to submit your code. But, it’s not testing your coding skill or anything like it. It’s just another effort to make our software (including games) better. It’s reviewing the code, not you.
Once I realized it and everything looked different. A reviewer did not look like a judge anymore. I started to feel free from defending my code changes and it made me open my eyes to see so many advantages of Code Review, avoiding duplicate codes, learning different points of view , understanding hidden assumptions and improving communication skill. ( and your English as well if you are from non-English speaking country, like me.)
Also, I’ve found that I unconsciously imagine myself as a code reviewer and see my code changes before asking review. It’s so helpful to find mistakes and better ways to improve the code I just wrote. I believe the most valuable thing of Code Review is not reviewing itself, but making yourself as a reviewer of your code. It might be the best way of training to be an egoless programmer.
2. You are not your code. Remember that the entire point of a review is to find problems, and problems will be found. Don’t take it personally when one is uncovered. – from The Psychology of Computer Programming
I should mention that it stops me being in a hurry to finish my tasks as well. Most of mistakes happen because we hurry. It happens so frequently especially when we are close to a release date or an important patch date. That’s why my team forces us to get double code review to avoid rush causing serious problems. Don’t forget that Haste makes waste.
If I go back to Korea, Code Review is the first thing I will brining with me. 🙂