Why I Program

On the bus this morning, I read part of "The World is Flat" that deals with left-brain versus right-brain activities; to Friedman, jobs that can be replaced by technology and outsourcing (left-brain) and those that require an element of creativity (right-brain). Friedman made a statement:

"This weekend there will be accountants painting watercolors in their garages. There will be lawyers writing screen plays. But I guarantee you that you won't find any sculptors who on weekends will be doing other people's taxes for fun."

Friedman is trying to convey that some things are done out of passion, and some out of necessity. People do taxes out of necessity, people paint watercolors out of passion. It's all very black and white, and the jobs of necessity are the ones that are more easily sent overseas to India.

Can't there be be passion for traditional "jobs of necessity"? You can outsource your financial management to an established group or mutual fund -- but what about the excitement of finding good deal and making a sound investment? The satisfaction of having researched it and adding your own judgment to what you find? You need a table to eat dinner on, but can't creating that table be a creative outlet? When categorizing these jobs, I don't think there are clear cut categories; it's up to the individual to say what he is passionate about.

Whenever I go home or spend time with my parents, a lot of my free time is devoted to programming, and they can't figure it out. "You do this all day for your job [or for school]. Can't you put down the laptop?" While it's true that I sit in front of a computer for my day job, I'm working on problems of necessity. Database development isn't particularly exciting for me; what I've been working doesn't require a lot of creativity and seems mechanical. So, in my free time, I need to exercise my creative muscle, and I choose programming for that task.

I've often said that good code is beautiful (no, I'm not talking about the Perl Camel). A well designed component or architecture has elegance and sophistication; simplicity yet robustness. You step back, look at the code, say "Damn, that's gorgeous", and you know when you've created beauty instead of just hacking out a quick fix. This element of beauty is something that I've found lacking in a lot of code and with a lot of programmers. Too often programming is treated like a boring job of necessity than the passionate job of creativity that it can be.

This is why I enjoy coding in my free time. Sure, it's all ones and zeros when it comes right down to it, but the important thing isn't what the end product does; how you got there is so much more important. Programming gives you a chance to come up with creative solutions. And they don't even have to be real problems!

I spent an entire day obsessed with the idea of programming language quines, which are programs that print out their own source code. Sounds easy, right? "Just keep a copy of the source code in the code, and print it out. Oh crap. How do I recursively store the code in the code..." Quines are, as my office mate likes to say, mental masturbation: they produce no value and in that sense are worthless, but so incredibly amazing at the same time.

I look at quines and other beautiful code with the same curiosity and admiration that I look at pieces of artwork in a museum; I appreciate them not because of their utility, but because of their elegance. And I code as a hobby outside of my day job not as a task of necessity, but the desire to create beauty.


Alex Hutnik said...

I know what you mean. I spend a lot of time in class NOT doing technical things, so when I get home that's pretty much all I do: setting up stuff on my network, programming this and that, etc. It's like solving little puzzles.

Jason said...

great post. it resonated with me.

Andy LeClair said...

When my friends ask me about programming, my favorite reply is "I'm an artist, I just paint with different equipment."

Salvatore Iovene said...

Thanks, a good post supporting programming as art, as in this webcomic: http://geekhero.iovene.com/2008/10/21/the-art-of-programming/
Most people just can't see it.

Robert Robbins said...

I'm a programmer but I don't see coding as an art. If I want to be creative I use After Effects, Painter (not Photoshop mind you), or Propellerhead Reason. This is just another example of the overly logical mind seriously underestimating the true nature of the creative mind.

The Boss said...

Robert, do you even know how you're posting that comment? You're using the Internet. On an OS. On a Web browser. Is this software written by logic monkeys in a sweatshop? No. It was constructed by developers with a passion for what they were creating. The very fact that you can use a software stack that is reliable and interdependent to read and comment on blogs is a thing of beauty.

Drew Kutchar said...

Robert, writing good code is an art and just like true art very rare to come by. Now I'm not sure what you create using Reason or Painter or etc is actually considered art? Just cause musicians/graphic artists can use those softwares as their tools doesn't mean anyone who uses those will automatically create art... similarly not anyone who programs creates art. :)