Who's Your Coding Buddy?

I am continually amazed how much better my code becomes after I've had a peer look at it. I don't mean a formal review in a meeting room, or making my code open to anonymous public scrutiny on the internet, or some kind of onerous pair programming regime. Just one brief attempt at explaining and showing my code to a fellow programmer -- that's usually all it takes.


This is a companion discussion topic for the original blog entry at: http://www.codinghorror.com/blog/2009/02/whos-your-coding-buddy.html
2 Likes

Oh god, this is so true. Albeit I’m still not out of university, having dealt mostly with very strange assignment requirements, I noticed how the amount of crap that got past the radar greatly reduced itself when my classmates and I decided to give each other’s code a look, to the point that our professor (one of the absolute best programmers I’ve ever known) asked us how we were doing it, and once we explained, started encouraging peer review in the other subjects he was teaching.

So yeah, peer reviews rock.

1 Like

You are Jeff, I love you.

All well and good…as long as you work in a shop with more than one programmer. I am a one-man shop. I know AT LEAST three other people in the same predicament. And don’t just suggest to use each other as code reviewers…How would your manglement feel about you shipping intellectual property around the 'net to people in other shops, in some cases, actual competitors?

Cautionary tale: Being the lone wolf sounds cool, until you’re the one howling by yourself in the moonlight.

Like many things, I think open-source projects have been doing this for years out of necessity even when it wasn’t as popular in corporate environments.

I can’t really imagine a project without some form of code review, now.

There’s an interesting side-effect to getting reviews, though, which is that when I know I have to go through one, I often am a little less vigilant about my own code than I am on projects that don’t involve review (like personal projects). I won’t test quite as much, because the reviewer is likely going to test. I’ll still usually look over my code before I submit it for review, but sometimes not as thoroughly as I would if it isn’t going up for review.

Basically, a slight amount of the responsibility gets transferred to the reviewer that would normally be on me.

They’re still great things to have, though, and overall I think they really do improve things. Reviewers often see things that I never would have, even if the reviewer has less experience coding on the project than I do.

-Max

Wow! If only I had figured out that having a successful blog involved copying pasting 3/4ths of all your posts. Profit! Nice work.

Hi Dieseltime, I see that you are new to Coding Horror. Enjoy the archives! :slight_smile:

In your list, I can’t believe you’d left out the Ambiguously Gay Duo.

I figured you would have had John Carmack and John Romero

1 Like

I think I’ve had to debug code written by Cheech and Chong :slight_smile:

@Max that’s strange re lowering your standards. In my experience it has always been the opposite, knowing that people are going to review my work makes me less likely to be lazy because I know I’ll be picked up on any slackness.

I wonder what other people’s experience is? Maybe I’m a special case because I work on a code review tool :wink:

You left out Statler and Waldorf. Seriously though… I have had the opportunity to work closely with some really cool people the last year or two and it helped greatly to be sharing ideas and looking at the code to implement the ideas together. Talking through what you’re thinking about with someone else who’s head is in the same space is always a good idea

As a lone gunman for 10 of my 11 years in programming I have found peer reviews to be frivolous and counterproductive. I have learned nothing in a peer review that I didn’t learn by myself eventually. The problem with peer reviews is that the peer review gives management ammunition to fire you if you don’t live up to the expectations of even one of your peers.

You forgot to mention another great pair: Murtaugh and Riggs

The problem with peer reviews is that the peer review gives management ammunition to fire you if you don’t live up to the expectations of even one of your peers.

  1. the point of peer review is not to give ammunition but feedback to you. At a sane organization, anyway.

  2. I advocate picking your own peer review buddy, for the most part, so you enjoy the experience.

Batman works alone a lot too though… because his sidekicks keep getting killed… so he is probably not a good example :stuck_out_tongue:

1 Like

I like the term coding buddy. Having multiple eyes on code works for Lixus, why wouldn’t it work for your code?

The next questions is, why after plenty of evidence that code reviews create value, improve quality, and increase velocity, do we avoid them? This is a human problem, not a procedural one.

A rose is a rose by any other name? Isn’t this just a form of editing? Works for writers, academic research papers and a whole host of other constructive disciplines. Why do programmers think that can just bang it out once, and have it declared perfect? Particularly when – by most definitions – it’s the first time they ever wrote something like this.

It’s a strange occupation, often growing stranger.

Paul.

Myself.

I’m currently self-employed so I’m a single developer business here. I find I can successfully review my own code by reviewing it first thing the next day.

Works better than most people would think.

Laurel and Hardy? :open_mouth: