Code as a form of Art

2022-04-13

Despite what you might feel, code is a form of art. Every line of code that you produce is a work of art, pure beauty.

It is a common misconception that code isn’t creative and isn’t very interesting for the left-minded. I dispute that assumption, for it is based on presumptions made by people who’ve, in my opinion, never actually programmed or, for that matter, written a single line of code. As much as you may be led to believe that a lot of the software engineering process is about looking up things and modifying them to your use case, it is not. A lot of the software engineering process is about looking at problems, breaking them down and solving them in elegant ways.

As much as elegance is an essential part of judging “typical” works of art, it applies significantly to code. You could write a workaround solution that works, which is fine. Still, nothing more than that or you could thoroughly understand a concept and implement a particular solution elegantly by subdividing the problems and building the solution for the original problem. You can already probably tell the second form is way more elegant.

Elegance is the way to great art. Subpar art “feels” uninspiring. There is nothing special or charismatic about it. On the other hand, great works of art inspire thought and imagination and, so to say, are “moving”. Most great works of art are elegant in creation. They follow a creative process that sets them apart. They do not attempt to copy but only take inspiration from other works. Similar is the work of code. Subpar code is available everywhere, from tutorials to blogs to videos. The real gems are hard to find and understand, but they are the ones that set your thoughts in motion. Something as simple as making calls to a database could be made elegant by making the code as readable as a storybook while abstracting away the parts that do the hard work and making it seem like a breeze.

The fastest algorithm won’t win the speed war unless it’s understandable and elegantly implemented. If your code isn’t readable and elegant and flows systematically like the greatest works of art, it would succeed, though, only to an extent. The best projects perform the task of elegance better than anyone else.

Focus on charisma and inspiration, for optimisation is much easier than refactoring.