Get Off My Lawn! (Code Ownership)

Ever met a programmer that is territorial about his or her code? Are you that programmer? I’m going to take a couple of minutes to explain why I think that’s a bad idea.

First, let’s consider why a programmer might want to keep other programmers out of “their” code (or, at least, what I assume is their reasoning when I encounter it.)

In order of suspected likelihood:

  1. They don’t trust the other programmers on their team.
  2. They don’t have confidence in their own abilities and are afraid of getting “found out.”
  3. They think that being the only person that understands a particular piece of code grants them job security.

Assuming one of the reasons above is why a person wants exclusive code ownership, here is what they might be missing:

  1. If you don’t trust your team members, you should find out why you feel that way. Perhaps it is an opportunity to mentor someone. This is as beneficial, if not more, to you as it is to them. You gain better understanding of something when you teach it. Also, any decent manager will recognize the value of an employee that improves the people around them.
  2. If you lack confidence in your abilities, maybe you need a mentor. It is much easier to improve if you enlist the help of others trying to reach the same goal. Also, if you involve others and the code ends up failing, the blame is shared by the team and not just you.
  3. Nobody is irreplaceable. I don’t care how good you are or how much you know, there is always someone else that can pick up where you left off. Actually, the easier it is for someone else to learn your code, the better job you did. The reverse is true, too.

One last thing. If you’re working for someone other than yourself, the code probably doesn’t belong to you anyway. It belongs to whoever paid for it.