Tuesday, 21 January 2014

The Importance Of Code Reviews

When I started coding, the thought of having my code reviewed filled me with horror. Some way into my career, code reviews were imposed upon me and I hated them. I aimed to get my code through review without any flaws getting picked up. This never happened, and every flaw pointed to how bad a coder I was. Somewhere along the line, I noticed that not much code sailed through my review process when it was my turn to review code. And then I noticed that if my code did get through a review unchanged, I felt disappointed - because I felt like:
  • I'd missed an opportunity to learn something
  • The reviewer had probably rushed through, because there is always something that can be done better
And I changed my perspective. I now feel that:
  • The lone code-slinger does not create the best code. Teams write code, not individuals
  • Having your code commented on by somebody else is one of the best opportunities you have to improve
I now worry about a time I might have to write code that I cannot get reviewed... If your workflow does not include a code review stage, you need to review it. And then think about getting a QA department.

No comments:

Post a Comment