Sunday, November 22, 2009

Why Computer Programmers Would Make Good Legislators

By Alan Burkhart

CodeFade No clue why this occurred to me, except that I stopped working on a programming project (my hobby) to read the news, which these days is almost all political. I read yet again about the sheer size (2000+ pages) and cost (who knows? Probably trillions) of the so-called health care reform. And as I read I began to wonder just how much of the final bill will be legitimate legislation and how much will be end-runs, workarounds, patches, what-ifs, and so on.

Every time a new law is created, whatever problem they were trying to solve usually gets worse (and more expensive). But, rather than repealing or rewriting the buggy law, they just keep piling on more legalese and spending more money until the original problem finally goes away. But as we all know, in the process of writing all this massive, mindless legislation, they invariably create a brand new mess of problems.

And of course, they now feel the need to write yet more laws to solve the new problems (that they caused), and the vicious circle continues. The bank failures, courtesy of The Community Reinvestment Act, come to mind.

Imagine if a programmer behaved in such a way...

You write a block of code to access a certain file, but in the process you create a bug in another part of the program (a common occurrence). What do you do? You remove the offending code to eliminate the problem,  then you think it through, and then you write new code that accomplishes your purpose of the moment without creating the problem.

headbang But what if instead you simply applied some sort of cheap workaround instead of properly fixing the code? In all likelihood, you'll have broken another part of the project without even knowing it. You don't find out until a week later, and by then you've forgotten the aforementioned workaround and have no clue why the program is behaving so badly. So you write a workaround for this, too. You end up with twice as much code as you should have and the  program is a house of cards – subject to falling apart at any moment.

Am I stretching my often-questionable logic too far here? Maybe. But imagine for a moment if legislators wrote legal code like most of us nerds write computer code. When (not if) a new law totally screws an unrelated sector of society, you go back and remove the block of legal code that caused the problem. And then you figure out how to rewrite the law without causing collateral damage. You don't just pile on hundreds of lines of lawyer-speak until the problem goes away. Imagine – sensible, constructive legislation that pays Paul without robbing Peter.

The health care legislation currently being debated in the Senate is in excess of two thousand pages. That's a lot of legal code. I wonder how many "bugs" that'll cause? I daresay a system-wide crash will be just around the corner if it passes.

Perhaps before passing a new law to solve a problem, our legislators should consider instead repealing the law that caused it.

Discussion at Free Republic:

Discussion at The Code Project: Click here