� Military Defends Use of Affirmative Action | Main | Are You a Terrorist �

February 09, 2003

Spaghetti Code, Stare Decicis & Patriot II

Someone once told me that you never know how your writing is going to affect other people. I am thinking about that and something my friend Charles told me.

Charles recounted a scene in Thomas Bolt's "A Man for All Seasons" in which Thomas More compares the complexity of law to the trees of a dense forest. More, a great lover of the law, argues that if we were to knock over all the trees in the forest, any fool could get through. He errs on the side of complexity in law. Since there will always be usurpers and traitors, it is better that the complexity of the law makes it difficult for them to achieve their ends, even if the result is that the law becomes too sophisticated for the ordinary good man to understand.

I was struck by this reasoning despite the fact that for most of my life, I hoped that the United States would enact flat taxes and clear the books of silly laws like those against spitting on Sundays. We have huge numbers of laws on the books. I have also always held a gripe against the irony that most attorneys must pay Lexis in order to use that electronic law library which contains some of the only copies of certain obscure laws. Lexis' categorization of the law is the defacto standard naming convention, and it's copyrighted. You must pay Lexis to use the law.

A week or so ago, I did a one week engagement at a local motion picture studio. Part of my job was to fix some spreadsheet macros. I haven't programmed in Visual Basic, Microsoft's scripting language, for about 4 years. Suddenly I was confronted with a problem and a deadline. Sure enough, I worked through it, but I swear that I was going to quit first. I took one look and I saw a tangle of code as dense as any untrackable forest. Spaghetti code is what we call it. Software is not narrative. It travels back and forward in loops and recurses back on itself, and that's just the structure of the program. The data that travels through that structure flies through a hundred tangents, mutates constantly and often inexplicably. Just as often as not you just leave entire sections of code alone hoping they'll do the same thing every time without bothering to understand it. On other occasions, you slash and burn whole forests of code, growing your own groves and gardens. In this case, I did both.

One principle that works for me as a programmer is that if you are going to do something complicated, you should use simple tools. That's because sooner or later you are going to have to change it or adjust it so that it will continue to be useful to others long after you are gone. A conscientious programmer leaves a trail of crumbs through his forest of code. But sometimes, you want to leave your code so complicated, even obfuscated, that it cannot be repaired by anyone less sophisticated than yourself. This is defensive spaghetti. Often, your customer will change their mind in the middle of a project saying that they want to do 'B' instead of 'A'. The best use of defensive spaghetti is around such 'assumptions' of a system. You leave in the code which accomplishes 'A' even though it is never used. When you do this enough times, you often just put in a bunch of 'A' code, just in case. It makes it difficult for someone else to understand and modify, but the entire program is more robust.

I understand and respect defensive spaghetti code and now I realize that I will have to respect that in the law. I have always seen parallels between the kinds of programming that I do - writing to influence people's behavior, and that of the law. I have always felt, however, that legalese was the kind of obfuscation which deteriorated the quality of public life. I don't want to simplify my applications so some newbie can walk up to them and take immediate ownership. They need to grasp the subtleties of the craft and understand why every statement in my code exists, even if it seems unreasonably complex. There is a reason for the complexity, it addresses the robustness of the system, but it has the added benefit of saving my customer from the inexperience of junior programmers and amatuers.

Finally, I have been able to see and hear people discuss the matters of the day with some sophistication. The web has finally grown up and the blogosphere is what I have been awaiting for some time. I have been most impressed with law professors and those who would engage in the arcane arts of policy writing. Now that I have made this concession, it has put me in a deep bind which has a great deal to do with trust. My trust is being tested this weekend by the Domestic Security Enhancement Act of 2003, also known as Patriot II.

Unlike Visual Basic, I've never taken a class in reading the law. Although I used to test myself with sample LSATs and assisted some friends with their preparation back in the day, I've not come close to a disciplined and nuanced understanding of what goes into construction of legal spaghetti. I would imagine that a conscientious attorney or legislator would provide some bread crumbs through the tangle, but as a layman, I cannot tell how elegant or not this particular piece of work is in its technical merits. I must trust some interpretation of all that. What has outraged me from the interpretations I have gotten seem to have left most of America in silence.

I am in a quandry as to the reasons for this silence. I have taken it upon myself to initiate a kind of simple and symbolic campaign any idiot with half a brain and a website could follow. So far the reaction has yet to sweep like wildfire. What is more disturbing however is the lack of interpretations I might follow to better understand what the hell is going on here. This suggests to me several things.

1. People are waiting for clarification and not jumping to hasty conclusions.

2. People are waiting for their favorite pundit to declare something

3. People are slowly stewing frogs who don't realize they are in the soup.

4. People are apathetic idiots.

5. People are incapable of seeing their own fate sealed in this.

I've been writing this essay for a long time, and I've been trying to say something elegant for a long time. I want to say something that any number of people can look back on 50 years from now trying to debug the past. I'm trying to lay some bread crumbs myself, because we are deep in a thorny thicket. What worries me the most is that the twisted sophistication of this proposal will become ossified into the petrified forest of an authoritarian police state which was once America.

Since I'm of type 1 above, and I don't want to rant in ignorance, I'm going to pace the floor while people who understand how this spaghetti could be unraveled chop it up into small pieces. I'll tell you now, that I don't need to untangle it to know that I don't like the smell, and I'm not going to swallow it.

Posted by mbowen at February 9, 2003 08:18 AM

Trackback Pings

TrackBack URL for this entry:
http://www.visioncircle.org/mt/mt-tb.cgi/148