Wednesday, December 08, 2004

Code-mungers (and -mongers)

Programmers and lawyers have a lot in common:
  • Both create code
  • Both are concerned with edge cases
  • Both have to transpose messy human reality into special languages
  • In both cases, a misplaced comma makes a huge difference to meaning and outcome.
Both practices are at the mercy of the small gods of unintended consequences (Kokopelli, Loki, Tyl Uilenspiegel?). When a software program does something unintended, it’s called a bug; when a law doesn’t work as expected, it’s a loophole.

(Of course, loopholes are often inserted on purpose and with the informed consent of the legislators, which cannot be said for bugs. However, the status of bugs is often ambiguous, as in the line sometimes heard after a product’s shipped, “Oh, that’s not a bug, that’s a feature!”)

Unintended consequences are prevalent for the same reasons in both cases: complexity and “embedded abstraction”. In any sufficiently complex system, the interactions between the parts cannot be predicted, other than to say that there will be unexpected interactions. This is the case both for large bodies of code, of both the legal and computing variety.

Some of the complexity derives from the fact that abstraction is a necessary part the process of cutting code. Laws and programs both model reality in order to make a workable product. Of course, any intellectual process does this, from poetry to civil engineering. However, software and legal documents both then loop back to interact with the worlds they’ve modeled in a recursive way. Their work product is a model; the same cannot be said of an engineer’s bridge. Software that models business process becomes the way the process is driven; contracts model commercial or social interactions, and then become the subject of those interactions.

No comments: