<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Made of Bugs &#187; ksplice</title>
	<atom:link href="http://blog.nelhage.com/tag/ksplice/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nelhage.com</link>
	<description>It's software. It's made of bugs.</description>
	<lastBuildDate>Thu, 18 Aug 2011 21:57:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Confessions of a programmer: I hate code review</title>
		<link>http://blog.nelhage.com/2010/06/i-hate-code-review/</link>
		<comments>http://blog.nelhage.com/2010/06/i-hate-code-review/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 00:21:11 +0000</pubDate>
		<dc:creator>nelhage</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[code review]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[ksplice]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://blog.nelhage.com/?p=241</guid>
		<description><![CDATA[Most of the projects I&#8217;ve been working on today have fairly strict code review policies. My work requires code review on most of our code, and as we bring on an army of interns for the summer, I&#8217;ve been responsible for reviewing lots of code. Additionally, about five months ago BarnOwl, the console-based IM client [...]]]></description>
			<content:encoded><![CDATA[<div id="text-1">

<p>
Most of the projects I&#8217;ve been working on today have fairly strict
code review policies. My <a href="http://www.ksplice.com">work</a> requires code review on most of our
code, and as we bring on <a href="http://blog.ksplice.com/2010/03/quadruple-productivity-with-an-intern-army/">an army of interns</a> for the summer, I&#8217;ve been
responsible for reviewing lots of code. Additionally, about five
months ago <a href="http://barnowl.mit.edu/">BarnOwl</a>, the console-based IM client I develop, adopted an
official pre-commit review policy. And I have a confession to make: I
hate mandatory code review.
</p>
<p>

I should be clear that I think I still <b>believe</b> in code review
as a useful tool for developers working together on a project. A
reviewer will flag as bad style or inefficient or ugly things that you
let slide working for yourself. A reviewer comes at code without the
assumptions of how it&#8217;s supposed to work that you made, and can often
spot errors you made because mixed up a mental model of your intent
with the code you actually wrote.
</p>

<p> In addition, code review is a great way to ensure that at least
two people are familiar with each piece of your infrastructure. There
is often a natural tendency for different developers to take ownership
of specific pieces of code or infrastructure, and be the only ones who
touch or maintain it. But then it breaks while they&#8217;re on vacation,
and everyone else is left trying to figure out how this code was ever
supposed to work. A mandatory code review policy is often a great way
to mitigate that class of problem.
</p>

<p> But, theoretical and observed benefits of code review aside,
speaking personally, as both a developer and as a reviewer, I&#8217;ve been
finding it a really frustrating process.  </p>

</div>

<div id="outline-container-1.1" class="outline-3">
<h3 id="sec-1.1">As an author </h3>
<div id="text-1.1">


<p>
As a developer, I hate that code review adds unpredictably long
latencies into my development workflow. Once I&#8217;ve finished and tested
a feature to my satisfaction, and sent it off for code review, I have
to wait for a potentially long time before I can actually mark it as
done. This means that, when deciding what to do next, I have
essentially three choices:
</p>
<ol>
<li>
Busy-wait. Get coffee, read reddit, and check my mail until the
review request comes back.

</li>
<li>
Continue development on top of the code I just sent for code
review.

</li>
<li>
Work on something completely different.

</li>
</ol>

<p>All three of these options suck. (1) is convenient if I can expect the
review to come back shortly, since doing something idle like reading
reddit or checking mail lets me keep the code in the back of my mind,
so I don&#8217;t have to page it back in when the review response comes
back. But obviously it&#8217;s inefficient, wasted time, and unacceptable if
I don&#8217;t expect a reply within an hour at most.
</p>
<p>
(2) is often what I want to be doing. I&#8217;ll often be working on a
project with several logically distinct but related stages. It often
makes sense to send out a review request for each, since they can be
deployed and reviewed separately.
</p>
<p>
However, if a reviewer comes back with significant comments on the
code I sent out, I now not only need to update that code, but I also
need to rebase the work I&#8217;ve done since then on top of the result,
which may be a real pain if I&#8217;m working on something closely related
(e.g. if my work used APIs I built previously, and the reviewer asks
for changes in those APIs in some way).
</p>
<p>
Option (3) avoids both problems, but means that I&#8217;m continually
swapping different projects in and out of focus. This slows me down,
since I have to constantly re-remember where I was in each project,
which APIs I was using, and so on. Any developer can tell you that
they hate switching between different projects too frequently.
</p>
<p>
Option (3) might be more tolerable with large projects, where
development/review cycles are on the order of weeks. But those aren&#8217;t
the projects I&#8217;m working on.
</p>
</div>

</div>

<div id="outline-container-1.2" class="outline-3">
<h3 id="sec-1.2">As a reviewer </h3>
<div id="text-1.2">


<p>
Reviewing code is one of those things that I would enjoy if I had
infinite time, but that I find a nuisance when I don&#8217;t. I do enjoy
reading other peoples&#8217; code and figuring out how it could be better,
and giving feedback to help get it there.
</p>
<p>
But doing so well takes a lot of time, and a lot of time is something
I rarely have these days. In addition, because of my above complaints
about dealing with code review as a developer, I&#8217;m always acutely
aware that someone is probably waiting on my reply in order to get
work done. So I always feel rushed to reply to code review requests,
as well.
</p>
<p>
So, even though I always feel like code review should be something I&#8217;m
enjoying, I tend to find it a frustrating experience where it just
feels like a task I have to do before I can get back to real work.
</p>
<p>

This is, of course, in part just a symptom of being too busy, but code
review makes it a task that bugs me more than other time drains. If a
customer reports a critical bug that I have to drop everything to
investigate, I&#8217;ll be annoyed, but I at least feel like I&#8217;m doing
something important that fixes a real problem and hopefully ends with
a happy customer. If I spend a day doing nothing but reading code
reviews, I&#8217;ll end up feeling unsatisfied and unproductive. Because
code review feels fundamentally optional &#8212; even though I believe it&#8217;s
beneficial, it&#8217;s something we&#8217;ve chosen to do, not something that we
absolutely have to do in order for the project or business to keep
operating &#8212; it&#8217;s more frustrating to find myself spending a large
amount of time on.

</p>
</div>

</div>

<div id="outline-container-1.3" class="outline-3">
<h3 id="sec-1.3">In conclusion </h3>
<div id="text-1.3">


<p>
I believe in code review as a powerful tool. But in practice, I&#8217;ve
found it frustrating to work with. I&#8217;d like to hear your thoughts:
Does code review work for you? Am I doing it wrong, in some ways? Is
it just a question of changing my attitude in some way?
</p>
<p>
I know that a lot has been written about doing code review
effectively. I&#8217;d appreciate pointers to anything you&#8217;ve found
particularly compelling.
</p></div>
</div>

<p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nelhage.com/2010/06/i-hate-code-review/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
	</channel>
</rss>

