Saturday, October 17, 2009

Flocks of Programmers

Flocks of birds and software developers fly on three very simple rules:

  1. Separation — Don't run over your neighbor.
  2. Alignment — Make your flight vector similar to your neighbors'.
  3. Cohesion — Have a common destination.
The difference between the "V"s of geese and the ever shifting clouds of starlings is the level of cohesion and the variance in their alignment.

Geese have waypoints; starlings, not so much. Starling flocks have a lot more coupling - they have many neighbors - and a lot less cohesion.

So, the question for software projects is, how do we reduce the coupling and increase the cohesion?

  1. As Robert Frost said many years ago, "Good fences make good neighbors." For programs, good interfaces reduce coupling and negative interactions.
  2. Increase bandwidth. One of the agile techniques is to have a very structured daily 15 minute "scrum" meeting: each developer says briefly what he accomplished the previous day, what he expects to accomplish today, and any issues he has. This helps keep all the developers aware of everything that is going on, helps maintain separation, and helps improve alignment.
  3. Decrease latency. The open source mantra is "release early and often." This is where distributed revision control systems (e.g. git, Mercurial, DARCS) shine and where the open source technique of publishing patchsets on an email list is very beneficial; long windy roads can be straightened out before they become a serious problem.