SpicyCode

The ramblings of Chad Humphries

Who’s code is this?

leave a comment »

Martin Fowler has put up a nice posting about Code Ownership.

I think we have all had the experience of working on a project and getting everything tied down except for that one piece of functionality that rests with another person.

In most cases things work out for the best, but there are always times when code ownership is best discussed up front.

In his post Martin outlines the following general modes of code ownership.

  • Strong code ownership breaks a code base up into modules (classes, functions, files) and assigns each module to one developer. Developers are only allowed to make changes to modules they own. If they need a change made to someone else’s module they need to talk to the module owner and get them to make the change. You can accelerate this process by writing a patch for the other module and sending that to the module owner.
  • Weak code ownership is similar in that modules are assigned to owners, but different in that developers are allowed to change modules owned by other people. Module owners are expected to take responsibility for the modules they own and keep an eye on changes made by other people. If you want to make a substantial change to someone else’s module it’s polite to talk it over with the module owner first.
  • Collective code ownership abandons any notion of individual ownership of modules. The code base is owned by the entire team and anyone may make changes anywhere. You can consider this as no code ownership, but it’s advocate prefer the emphasis on the notion of ownership by a team as opposed to an individual. (The term collective code ownership comes from Extreme Programming, although in the second edition the practice is called Shared Code.)

I personally enjoy the collective ownership model the most. However, any code ownership model is better than none being in place.

Advertisements

Written by spicycode

May 15, 2006 at 5:47 pm

Posted in programming

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: