<CharlieDigital/> Programming, Politics, and uhh…pineapples

15Sep/10Off

A New Euphemism for Bad Code

Ant Death Spiral (via Cynical-C).

This is one of my favorite things about ants -- the ant death spiral. Actually, it's a circular mill, first described in army ants by Schneirla (1944). A circle of army ants, each one following the ant in front, becomes locked into a circular mill. They will continue to circle each other until they all die. How crazy is that?

This is the perfect description for bad code and bad programmers (and poorly run companies!).  Each development cycle that builds on bad code just compounds the problem until you're locked into a code death spiral of "we don't have time to clean it up" or "it'll take too much effort to refactor it" or "this is just how we do it here".  Instead, each member of the team begrudgingly (or even worse, dutifully and mindlessly marching like ants) continues to use the bad code, copy and paste the bad code, and build on top of the bad code thereby creating more bad code and more dependencies on the bad code that become inexorably difficult to refactor and extract.

WHARRGARRBL!!!11!

In programming and software development, Paul Graham captures this concept perfectly in his essay on the failure of Yahoo! and why they fell to Microsoft and Google:

In technology, once you have bad programmers, you're doomed. I can't think of an instance where a company has sunk into technical mediocrity and recovered. Good programmers want to work with other good programmers. So once the quality of programmers at your company starts to drop, you enter a death spiral from which there is no recovery.

But not all hope is lost,

Sometimes they escape, though. Beebe (1921) described a circular mill he witnessed in Guyana. It measured 1200 feet in circumference and had a 2.5 hour circuit time per ant. The mill persisted for two days, "with ever increasing numbers of dead bodies littering the route as exhaustion took its toll, but eventually a few workers straggled from the trail thus breaking the cycle, and the raid marched off into the forest."

Avoid the ant death spiral!  As Fred Brooks suggests in The Mythical Man Month,

Programming managers have long recognized wide productivity variations between good programmers and poor ones.  But the actual measured magnitudes have astounded all of us.  In one set of their studies, Sackman, Erickson, and Grant were measuring performances of a group of experienced programmers.  Within just this group the ratios between best and worst performances averaged about 10:1 on productivity measurements and an amazing 5:1 on program speed and space requirements!  In short the $20,000/year programmer may well be 10 times as productive as the $10,000/year one.  The converse may be true, too.  The data showed no correlation whatsoever between experience and performance. (I doubt if that is universally true.)

Take the effort to find, work with, hire, or -- better yet -- count yourself among those programmers that can help teams avoid walking into the ant death spiral in the first place.  Address lingering issues and inefficiencies as soon as possible; fixing bad code early can yield huge gains in agility and flexibility down the line.  Never be afraid to break the cycle and call out bad code and poor practices.

Posted by Charles Chen

Filed under: DevLife Comments Off
Comments (2) Trackbacks (0)
  1. Hmmm, when has this ever happened in my professional life??? Then we brought on the infamous Chuck Chen! Love the Paul Graham article…thanks for sharing!


Trackbacks are disabled.