Call it a crisis of faith.

I'm sitting today, looking at some code, and part of me is disgusted. I know that I or any number of people could've done better with this code, but, well, we didn't. The code is what it is. Some of the methods are long, some of the classes are big. The code isn't a shambles. There are some very nicely factored methods that are almost crystalline in their structure, and they brighten up the rest of the code. All in all, we could've done better, but we didn't.

There comes a point when you look at something that has continually annoyed you and you realize that no, it isn't a complete mess. Yes, it's a bit disheveled, but there's a sort of beauty there. It's organic, and organic things have their own structure and form. They start simple, grow into use, and then they start to age and deteriorate. I think that anyone who has programmed for a while can map that biological cycle to code. If you're prone to be distressed by it, you have the opinion that code just doesn't die soon enough for your tastes. I know I've felt that way many times. But, seriously, if we can see this sort of biological quality in our code, why are we so upset by it? Methods and classes growing over time.. it should be the most natural thing in the world, shouldn't it?

I guess it comes down to our orientation to our code. Code isn't like a pet that we can admire for it's lovable qualities (or, maybe it is, we often have to clean up after it). Code is more like a working material. We have to understand it and cast our thoughts in it. When we can't shape it easily, it frustrates us.

A while back, Larry Wall described Perl as a post-modern programming language. What he meant was that Perl doesn't say that there is just one right way to do things. When you look at the language you realize that you can do just about anything you want to do, and you can do it in at least three or four ways. It's a cool idea, but.. you know... give me a real simple language with only one way of doing things. Give me a code base where all of the methods and classes are well factored and well named. Many of us like order because it just makes things easier. Every little bit of order is a like a little promise. It says "If you understand this one thing, you'll understand more. It all means sense.. it really does."

So, we have this tension between what we want, and what code seems to want to become. We strive for order, but we're surrounded by entropy. Giving up doesn't seem right but neither does working against the grain of software.

Maybe there is another way.