Your code is not art
February 23rd, 2014
I've come across quite a few places where code is compared to art. Mainly it is because we (programmers) attribute aestetic properties to it. We find code "beautiful", "clean". Yet I think, while we might actualy see and experience this beauty, that does not make it art. Why not?
A piece of code has a function, it must achieve a preset goal. This functionality, the end result, can certainly be a piece of art (a striking example of this is "A Map of the Age of all Buildings in the Netherlands". Absolutely gorgeous ). But this end result has nothing to do with the code to achieve it; it's beauty would not be diminished if the underlying program was written poorly.
So if we leave functionality out of the equasion, could we still be left with the code as a work of art? Who can appreciate this artwork? It has no properties but letters and numbers and a handful of other characters. In other words:
It's just a bunch of badly written english with massive [overuse of semi-colons](http://search.dilbert.com/comic/Overuse%20Colons).
And while my wife would be able to recognize the difference between "ugly" code and "beautiful" code if I told her what to look for, she would never call it art. And neither would I.
What is art? When you google that, is comes up with the following definition:
the expression or application of human creative skill and imagination, typically in a visual form such as painting or sculpture, producing works to be appreciated **primarily for their beauty or emotional power**.
It's that last part I have a problem with when it comes to code. We don't write code for the beauty of it. We strive for a functional result by following rules that result in a piece of "beautiful" code. It's this functionality, the correctness of the program shining through, that makes it beautiful to us. But we wouldn't even call it beautiful if it didn't work! I've often downloaded package or a lib from the interwebs that looked good at first glance. But if it doesn't work, it's garbage... (there's emotional power there, but not the right one. *grin*).
Keep in mind: this does not mean I think writing code is not a highly creative process. You see, the first part of the definition of art fits like a glove: the expression or application of human creative skill and imagination.
So for me, it's all about functional code, properly maintained. This is the kind of code we like to write, use and live with.
We'll leave the "art" to proper artists.
Pointy haired boss