William Ahern <
wil...@wilbur.25thandClement.com> wrote:
> Rainer Weikusat <
rwei...@mssgmbh.com> wrote:
> > "Ersek, Laszlo" <
la...@caesar.elte.hu> writes:
> > > On Tue, 17 Jul 2012, Rainer Weikusat wrote:
> Code review probably would never have caught this. Catching this bug would
> have required a thorough understanding of the timer infrastructure
> (especially the niche cases of tick adjustments). I mean, the reviewer would
> have had to foresee this kind of error (a missing line in some far flung
> module) and know to look for it. Very few other developers would have had
> this expertise. It's an unintended consequence of specialization; nobody
> around to fix the other guy's mistakes.
I like this last sentence. It's an important concept. I'm not sure there's
anything you can do about it but recognizing it is worth something.
> IME code review is usually more a waste of time than anything. You usually
> need someone as experienced or more experienced than the author wrt to the
> subject code. But that means the cost of the review is quite high; higher
> than most people are willing to regularly accept. Afterall, there's a reason
> the other experienced engineer is off doing something else.
I don't like code reviews either, what I ask my guys to do (and what I do)
is to run it past at least one other developer and explain to that person
what the problem is and how they solved it. More often than not, the person
doing the explaining will do the necessary face-palm when he realizes his
mistake, without the person listening having to do or say anything at
all. Code reviews create an adversarial environment at worst (not that that
is fundamentally unproductive, but in practice it usually is) and at best a
who gives a shit, where do I sign so I can get back to work attitude that
makes the whole review worthless. At the end of the day, code reviews are
just another "tool" for incompetent managers to CYA with, damn them.
> I'm not saying it can't be done systematically. It just requires a
> considerable investment in time. Maybe the best way to handle code reviews
> is to pair programmers together.
Yes!
> Each generally goes about his own business, but part of his responsibility
> is to keep track of what the other guy is doing (keeping his opinions to
> himself, lest egos get in the way).
No!
It's too expensive and it's just a fact of life in small to mid size teams
there aren't enough people for more than one person to own a piece of
code. And code ownership is crucial to code quality. I mean sure you can
say two people are responsible for knowing something but in practice it's
almost never realistic. It's better to ask people to discuss things with one
other developer. That alone solves 95% of the problems.
> When he's finally tasked with reviewing some particuarly hairy bit of code
> he can come up to speed immediately.
On the code I have seen and worked on, that isn't realistic. We have a lot
of code and becoming a subject matter expert takes many years. We have never
had enough money to hire enough guys to have more than one person really
know any one thing and in practice I don't even know if it's possible for
more than one person to be truly expert on a piece of code just because of
the head banging that would have to happen to get to that point. I mean what
do you do, give every other problem to one of the guys? Just because they
worked on half the problems doesn't mean they understand things at the same
level. Certainly splitting the work down the middle is one way to give
people the best chance possible to know a piece of code, but in practice
what usually happens is people gravitate towards what kinds of problems they
solve, and they split the work themselves according to thematic lines rather
than simple work load management. And all that does is make the module you
assigned them both to be responsible for into two, smaller modules.
> Sort of like a President and Vice-President situation. The VP keeps his
> mouth shut, and in return the President keeps him apprised of everything
> that's going on so the VP can immediately step into his shoes when
> required.
I think that is an extreme oversimplification. It is much simpler for
corporate types to exchange information than it is for technical people,
because of what is being discussed. It doesn't take 5 or 10 years to learn
this quarter's business plan, obviously, but it can take that long to really
understand a few hundred thousand lines of source code in a multi-million
line system.