The Value of Self-Serving Code

It's Friday night. I'm writing code. Not good code, mind you. Crappy code. Completely self-serving code that serves only one purpose: to solve a problem I alone have. No one else will see this code. No one else will use this mini-app. I'm writing it for myself and myself alone.

I did not test this code.
I did not use a framework.
I mixed PHP and HTML in one file.
I'm sure there are numerous XSS and other wonderful security vulnerabilities present.
My code is not indented properly.
My code is procedural, poorly documented and hard to follow.
It is not scalable.
Hell, it probably won't even load in IE.
It looks like ass, too.

In fact, I think I may have broken every best practice I can think of, and probably even a few that escape me at the moment.

And you know what?

I. Don't. Care.

I'll tell you why I don't care.

The value of writing a crappy self-serving mini-app is akin to the value of journaling. Sometimes it feeds your soul to write stuff just for the heck of it. Writing for your own purpose, and for no one else to see. Just to get the ideas down on paper. To throw the rules of grammar and spelling to the wind. To throw the thesaurus and sentence structure right out the window. To write just for the sake of writing. In fact, that's what NaNoWriMo (that some of you may be familiar with) - is all about. To write for the sake of writing, not to write a masterpiece. It exists only to get your creative juices flowing.

How many times has our creativity been stifled by our own perfectionism? We have an idea for an app, and we try to do everything perfect from Step 1. This will be the app of the century, we tell ourselves. This code must be perfect. We must get everything right from the very beginning. Everyone will see this code. Everyone will use this app. Our reputation will be on the line!

Before we know it, the development of our app has stagnated. We get bored. We come up with another idea that is even more exciting, and we abandon the old for the new. Shampoo. Rinse. Repeat. The cycle never ends. Burnout is inevitable.

I say screw that. I challenge you to write a few lines of crap code that solves a problem you have. Be selfish. Break the rules. Stir it up a bit. Write some crappy code that serves a purpose for you and you alone. Just because we work in open source does not mean we have to always open our source. Make this code for your eyes only.

Of course, I'm not advocating actually deploying your crappy code, in the same manner I wouldn't recommend you sending your personal journal to Random House for potential publication. So don't expect to write shitty code, get sued or worse, suffer public humiliation, then blame me.

But for now, come on, get crazy. Change your files *right on the production server*. I won't tell.

The Winds of Change

I just wanted to post a quick blog entry to say goodbye to Marco Tabini and his staff at php|architect. I've worked with them for a few years now, but all good things must come to an end, as they say.

I greatly appreciate all the opportunities they offered me, and I had the chance to meet many interesting people through my work there. It was truly a great experience, and one I'm very thankful for.

I'll still be working for and I have also signed on to Wiley as a Consulting Editor, so that elusive thing called "free time" will be forever elusive, I fear :).

(I may also have a few other things in the works... but I'll save those for another time and another post. :) )

Gender in IT, OSS, & PHP, and How it Affects Us *All*