Current Articles | RSS Feed RSS Feed

Code reviews: Who needs them?

Posted by Jon Friedman on Wed, May 25, 2011 @ 07:54 AM
 

This comes from Titas Norkunas, the developer of our code commenting and simple code review features.

Every developer is an optimist at heart. We always believe things will work out. The code will compile! If it compiles, then it will work.

And that’s when the real world hits us. The code does not always compile, does not always work, is certainly not free of bugs, and sometimes crashes. And this happens to us for simple reasons: we are too optimistic, we don't double-check, we can't think of everything, and we make mistakes.

Teams try many techniques to counteract excessive optimism. Some use pair programming. Some have very strict processes. Some write three times more tests than code. But are these time-consuming techniques a good investment? And more importantly, are they fun?

Pair programming can be a good investment, and it is absolutely fun. But the pairs need to synchronize their work, and that is especially difficult for distributed teams. There are some success stories, but I would argue that in practice pair programming rarely pays off.

One of the best practices to increase code quality and reduce mistakes is Code Reviews. They require less time from developers to produce quality code than other options. They provide a fresh perspective. They let you catch mistakes very early. They make you write better code.

And code reviews help teams share experiences:

  • That super-critical accounting component needs more tests? Ask for them during the code review, and they shall be written.
  • This component is messy and needs fixing? Show everyone why in the code review.
  • Your peers have developed neat techniques that you could use? You’ll discover them every day in code reviews.

At Assembla, we have found code reviews to be one of our most productive development practices. We do them daily.

And to make code reviews easier and more effective:

Gerrit is used in some of today’s largest open source projects, including Android. Inline comments is a more casual tool that intrudes less into work processes.

Check out our recent blog post "Simple Code Reviews with Inline Comments" to learn more about inline commenting. We think it will be a great tool for many teams.

Please send me your ideas about the inline comments, and we will continue to improve.

Tags: , ,

COMMENTS

There are no comments on this article.
Comments have been closed for this article.

Follow Assembla

twitter facebook youtube linkedin googleplus

Subscribe by Email

Your email: