4

How do you identify users when a programming pair checks in code? I heard a complaint that, often a junior dev will be at the keyboard, using his/her account, but is not going to be the best person to ask questions about the code being checked in (the more senior dev is likely to have the best answer).

Is this really a problem? Seems like a programming team could think of some way to identify pairs and get the necessary information in their version control software.

I also think they're not benefiting from this process if both programmers don't know what their code does.

7
  • 10
    If people are pair programming they should both know and understand what the code does, that's kinda one of the points of pairing. It shouldn't matter who checks the code in, as both developers should take responsibility for it and be able to step up and answer questions about the code. The Senior Dev may be better at explaining it, but the junior should be able to confidently answer questions too
    – Deco
    Commented Aug 13, 2013 at 0:24
  • 1
    @Deco - that's what I was thinking, but maybe I wasn't living in the real world or something.
    – JeffO
    Commented Aug 13, 2013 at 0:27
  • 4
    Additionally, worst case scenario where for some reason the Junior is not able to answer the questions they should at least know who they were working with and so should know who to ask for help in answering the questions.
    – Klee
    Commented Aug 13, 2013 at 3:51
  • 1
    @Deco: That's an answer and not a comment ;)
    – jgauffin
    Commented Aug 13, 2013 at 6:14
  • @Klee - while Deco is right in the general sense, you're entirely correct about the main reason it'd still matter. The one who checked it in might not be around any more, and you want to track down who the other one was...
    – Bobson
    Commented Aug 13, 2013 at 20:58

1 Answer 1

2

In the worst case scenario, the Jr Dev doesn't really understand the code and tells you to ask his partner about it. This isn't really a world ending scenario. It does, however, suggest that you're doing pair programming wrong. One of the benefits of pair programming is to facilitate knowledge transfer between developers - if your seniors are telling the juniors to just write code without explaining it, you've lost this benefit.

To mitigate this, you could require meaningful commit messages that explain what a particular code change did & the reasoning behind it. If you're afraid somebody might forget or leave the company, making a note of who they paired with in the message won't hurt.

1
  • Having a way to document everyone involved seems to make the most sense. I've been looking at a code base that I wrote 98% of and don't recognize a lot of it. Maybe my memory is not as good as others.
    – JeffO
    Commented Apr 1, 2015 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.