what is it about coding?

January 12th, 2008

This week marks the release of KDE 4 with a lot of noise. But what strikes me more than the actual code being released is all that I've read about kde4 ever since I started reading Planet KDE quite regularly last year. I've read the words of many people who are above all very excited about whatever it may be they are currently working on, big or small. There is a palpable widespread enthusiasm in that community (at least among the people who like to blog).

The question is why. What are the kde people so excited about? A qt widget that auto adjusts on resize? Uh-huh. Why is Brian Carper so determined to learn Lisp when it's not his job and no one is pushing him to it? Jarosław Rzeszótko is a Polish kid who tried to map out the entire realm of programming so that he can spend the next however many years learning... everything. Why does he care so much? The programming subreddit is consistently dominated by esoteric programming languages and wild ideas, which suggests that there's a lot of hobbyism and experimentation going on, not just plain "working for the man". Why bother with all this tinkering?

When we see a thrilling musical performance, there comes that realization of just how much work and how much mental energy it must have taken to produce it. If you start today and you're very talented, you might be able to give a thrilling performance in 10 years. People devote their lives to achieve this. But hey, it's music, it's art, it's incredible. Listening to music performed this way makes you feel something you can't reproduce any other way. It activates feelings deep inside you and brings them to the surface, making you experience hurt, relief, harmony, ... just by listening to sound.

So what about coding then? Why do people care about coding? It's not art. It doesn't make the user have all these wonderful experiences they get from music, it's really no more exciting for them than... filling in forms. There aren't any art exhibitions for software. And if ever using software channels deep feelings, it's usually not in a good way.

But there is something about programming that very deeply appeals to us programmers. It is difficult to explain, and I have never found it explained by anyone... fully. How do you explain something you don't completely understand?

Well, until today. I just received my order from Amazon, "The Mythical Man Month", Fred Brooks's set of essays on software engineering. In the first essay, The Tar Pit, Brooks writes:

The Joys of the Craft

Why is programming fun? What delights may its practitioner expect as his reward?

First is the sheer joy of making things. As the child delights in his mud pie, so the adult enjoys buildings things, especially things of his own design. I think this delight must be an image of God's delight in making things, a delight shown in the distinctness and newness of each leaf and each snowflake.

Second is the pleasure of making things that are useful to other people. Deep within, we want others to use our work and to find it helpful. In this respect the programming system is not essentially different from the child's first clay pencil holder "for Daddy's office".

Third is the fascination of fashioning complex puzzle-like objects of interlocking moving parts and watching them work in subtle cycles, playing out the consequences of principles built in from the beginning. The programmed computer has all the fascination of the pinball machine or the jukebox mechanism, carried to the ultimate.

Fourth is the joy of always learning, which springs from the nonrepeating nature of the task. In one way or another the problem is ever new, and its solver learns something: sometimes practical, sometimes theoretical, and sometimes both.

Finally, there is the delight of working in such a tractable medium. The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexible, so easy to polish and rework, so readily capable of realizing grand conceptual structures. (As we shall see later, this very tractably has its own problems.)

Yet the program construct, unlike the poet's words, is real in the sense that it moves and works, producing visible outputs separate from the construct itself. It prints results, draws pictures, produces sounds, moves arms. The magic of myth and legend has come true in our time. One types the correct incantation on a keyboard, and a display screen comes to life, showing things that never were nor could be.

Programming then is fun because it gratifies creative longings built deep within us and delights sensibilities we have in common with all men.

In trying to formulate an answer to the question myself, I have only ever been able to clearly state the first of the mentioned facets: building things. The fluffiest and most intangible quality I see in the emphasized paragraph. In this respect I get people who don't understand programming. It is such a strange thing in many ways.

But it is also this that makes the endeavor forever interesting. Imagine a computer game that has such incredible depth that you can spend your whole life playing it and whichever dimension you pick you can never see the end of it. No matter how much you zoom in the picture, you can never see the pixels. No matter how refined your battle strategy is, you can never figure out the computer opponent, because as your strategy gains an ever greater granularity, so does his. And no matter how many levels you complete, there are always more left.

From a child psychology point of view, I may have been a surefire pick for programming (if someone were confident enough to foresee the PC revolution). I had building blocks from the beginning, and I loved Lego blocks more than anything else. I didn't really care about the structures they were for, I just built stuff. The only limitation to Lego blocks is actually the blocks themselves. There are only so many blocks, and there are only so many types of blocks. With rectangular blocks, you can't build something round. And with plastic blocks you can't build ships, cause the material is too heavy. And because the blocks are a certain size you can't build something that is both small and complex. And because the blocks are all the same material you can't do anything magical like make some parts lighter or run a current through a wire, because you need different materials for that.

I think of programming languages as blocks. They are what makes our programs "slightly removed from pure thought-stuff". They are what makes our abstract craft it into something real. But they also define and limit how we can build our castles in the air. Every programming language is a different straight jacket. A different set of blocks.

It is an interesting dilemma. We need languages to be able to express anything. A language, to be something, simply must be concrete. And with a concrete language we can build concrete things, but it is also the very same thing that limits what we can express. Without our language, our castles in the air have no restrictions. They are pure imagination. But they can also never be.

:: random entries in this category ::