Slashdot Mirror


Code Reviews vs. Pair Programming (mavenhive.in)

An anonymous reader writes: I've spent nine years working in teams which religiously follow pair programming. I'm used to working that way and appreciate the benefits it brings. We didn't have the luxury of pair programming all the time in my last project. This required us to do code reviews to ensure the quality of the code we delivered. This post is an attempt to consolidate the upsides and downsides of doing code reviews instead of pair programming in my three months of experience.

10 of 186 comments (clear)

  1. Re:Nine years of pair programming? by Anonymous Coward · · Score: 5, Interesting

    (Going anonymous)

    You are likely running this through a cultural filter.

    The Indian teams that I have worked with are a lot more about huddling around a computer working things out, than the typical US approach of developer with headphones collaborating a couple of times a day. Different cultures do things differently.

    Looking at *real* salary information between two geos (Bangalore and Silicon Valley) comes out roughly as follows.

          Architect level 2:1.
          Junior level 5:1

    You can have pair programming for junior staff and still have a very strong cost advantage in India. That cost advantage plus a cultural tendency would make pair programming fairly easy to apply.

    Not making any comment about the quality of code or quality of engineers on either side of the pacific...

  2. Watching someone code drives me insane by sanosuke001 · · Score: 5, Interesting

    Watching someone else code is the most maddening thing. They always seem to take the long way of doing something; use the mouse and doing eight clicks where a keyboard shortcut would do, etc. I do my best to not watch people code when I'm trying to help them. I would have killed someone years ago if I did that full time.

    --
    -SaNo
    1. Re:Watching someone code drives me insane by gstoddart · · Score: 3, Interesting

      There's no way in hell I could function in that close proximity to ANYBODY for 9 years. Not even my wife, and I kinda mostly like her.

      I don't wish to spend my day with someone right up along side me.

      My experience with it is 1-2 hours is the absolute upper bound, and then it's going to turn into two kids in the back seat of a car on a long ride.

      What idiot thinks doing this all day every day would increase productivity?? That isn't a team mate, it's a fucking cell mate.

      --
      Lost at C:>. Found at C.
  3. Code Review Pair Programming by i_ate_god · · Score: 4, Interesting

    A proper peer review process is far superior. Review your plan with your teammates. If you're working with components that others work on, make sure they are part of the plan review. Once all questions are answered, put your headphones on and go forth and code. Rely on unit tests to catch the obvious problems, rely on integration tests to catch less than obvious problems, rely on QA to catch what your integration tests miss. Use linting, static code analysis, and other tools like Sonarqube to identify potential problems within your code that may not manifest themselves under day to day usage. Voila...

    Is it perfect? Of course not. Will your software be 100% bug free? Of course not. It also doesn't solve problems related to lack of intelligence or experience amongst your teammates, and it doesn't solve problems related to lack of foresight from management who impose impossible deadlines or who close deals with customers that include features which don't exist. But the team will still be more productive than if they had to share computers and work in pairs. Programmers need focus and pair programming will ruin any focus you could have.

    --
    I'm god, but it's a bit of a drag really...
  4. Re:Nine years of pair programming? by alvinrod · · Score: 4, Interesting

    Even the early academic studies (PDF warning) of the effectiveness of pair programming found that you didn't quite get as much out of a pair team as two individuals working independently. However the code quality is generally a lot better in terms of correctness or readability.

    If you have a few individuals who are new to an organization or becoming acclimated to a new project they've not worked on previously, pairing can make some sense. On the other hand if you've got a rock-star developer that's head-and-shoulders above the rest, it's probably not worthwhile to pair them with another person.

  5. Team Reviews are far superior by Ckwop · · Score: 4, Interesting

    In our organisation, we have teams of six people that work together on their sprint. QA staff are included in this team.

    On major features, the team code reviews the feature together in a special session. Roles are assigned. The author is present, a reader (who is not the author) reads the code. There is an arbitrator who decides whether a raised issue gets fixed. This arbitrator role is rotated through the team on an inspection by inspection basis. Finally, there is a time keeper role who moves the conversation to a decision if one topic is debated for more than three minutes.

    This process typically finds a humongous number of issues. It takes us about 4 hours of applied effort to discover a bug in pure functional testing. This process discovers bugs at a rate of 1.25 bugs per man hour of applied effort. So if you have five people in a room for one hour, you have applied 5 man hours. You'd expect to find 6-7 bugs. If you include all the stylistic coding standards bugs, this is typically 10-15 bugs per hour.

    So while on the surface it looks expensive to have all those people in a room talking. The net result is that it tends to accelerate delivery because so many issues are removed from the software. Better still, the review occurs before functional testing begins. This means the QA staff on the team can direct their testing at the areas highlighted by the inspection process. This further improves quality

    It's true that about 50% of the ossies are stylistic issues. But usually we get 1 or 2 bugs per session that present a serious malfunction in the program. The rest could be problems under some circumstances or minor faults.

    Team reviews are vastly, vastly superior to pair-programming. There really is no contest.

    1. Re:Team Reviews are far superior by Ckwop · · Score: 3, Interesting

      You sound like a bean counter, and your organisation sounds like it is hell to work in. 1.25 bugs per man hour? Christ.

      Well I'm the head of development at our place so I inhabit both worlds. Businesses like to measure return on investment. By being able to speak that language, I can generally frame activities developers naturally want to do in those terms. This leads to developers getting more of what they want.

      You know what developers really, really, really hate? Having to work with technical debt and having no process to remove that technical debt because the program is now "working".

      The best way around technical debt is not to put it in to the program in the first place. This process does a sterling job at that. So our developers are generally a pretty happy bunch.

  6. Re:Nine years of pair programming? by eulernet · · Score: 4, Interesting

    This is nothing new.

    The effort of every individual in a group of people has been measured by Ringelmann in 1914, for army's purposes.
    Here is the original article: http://gallica.bnf.fr/ark:/121...

    And the results are (number of people => measured effort)
    1 => 100%
    2 => 93%
    3 => 85%
    4 => 77%
    5 => 70%
    6 => 63%
    7 => 56%
    8 => 49%

    This is called "Ringelmann effect" or more recently "social loafing".
    As you can see, 8 people produce the same amount of effort than 4 individuals.

  7. Context Context Context by gfdgfdwrg · · Score: 3, Interesting

    Pair programming when creating new features: FAIL. Pair programming with the guy who wrote the original code when you find bugs: EPIC WIN

  8. Re:Nine years of pair programming? by ILongForDarkness · · Score: 3, Interesting

    You're maybe a better coder than I or people I've worked with. I find the majority of my time isn't spent "writing" it is spent finding the stupid little errors like a != that should be an == or forgetting to do a null check etc. I type about 60wpm but commit maybe 100 loc of production ready code a day. The bottleneck isn't writing. It isn't thinking either: my list of "good ideas" and simple should do refactors grows faster than I can do them. I'm limited by my ability to find and debug stupid mistakes in code, whether mine or falsely blamed on me by CI.

    Pair programming could help with that I think (haven't done it for more than an hour at a time so don't feel confident stating an opinion one way or another0 because my tendencies towards stupid mistakes might not be the same as my pair. A quick: wait that is dumb every 10 min could save me hours of debugging. My guess though is that you should change pairs frequently so you don't start falling into the same mistakes as your partner or end up with 2 people that are the only guys that can review each others work because they are the only ones that have worked on X for a year.