After working on a code base for some time you are bound to start feeling more comfortable around certain areas. Especially if the code is expanding rather quickly. Often enough it is the areas you have created yourself that become the more familiar ones. You keep working on these areas, grab tasks that are related to them and as you do, you get more and more attached to them.
Before you know it. Yo consider this and that part of the code yours. As soon as someone mentions your areas you get an uneasy feeling, thinking to yourself. ‘What are they talking about. They better not be suggesting changes let alone actually doing any, on my module’. More and more often you feel that someone is threatening your little baby, you hold certain pieces dearer that other and without knowing it, you have become a CodeNapper.
It could be the other way around as well. Whenever someone asks if you or any other person could help with this or that you turn your head towards another person and say:
– ‘That is Bobs area.’
It is another symptom but the cause is the same.
How do one get out of this. Well, the way into this is certainly specialization. Work only on the same things today, as you did yesterday. Alone! Antidote: Collective code ownership. The way there is harder in practice than in theory. As with a lot of other things.
So, once again I would like to point your eyes to pair programming. It is useful in many ways but in this particular context its effect of spreading knowledge fast across a team is the one we are looking for. If two persons are pairing on a task today.
Tomorrow they both will have new partners and at least a third person knows about the area. Soon enough the whole team knows about the whole codebase. You will still have certain areas you have visited more that others. But not one single area should be unknown to you for very long.
If you have tried pair programming and do not like it or for any other reason cannot use it. Try rotating over different areas. Sort of trying to grab tasks that are not related to the one you just did.
If you routinely address or relay questions to the same person. It is probably time for more pair programming or responsibility changes. Chances are your bus number is alarmingly near one.