Tibor's Musings

Programming: Engineering or Poetry?

Is programming more like an engineering or it is more like an art?

I just came across a recent interview of Richard Gabriel for java.sun.com where he precisely pushes against considering programming as a sole engineering activity, underlines the role of creativeness and diversity and makes parallels between writing programs and writing poetry. An excerpt:

Traditions of computer science and software engineering have tried to turn all aspects of software creation into a pure engineering discipline, when they clearly are not. [...] Writing software should be treated as a creative activity. [...] My view is that we should train developers the way we train creative people like poets and artists.

—Richard Gabriel, "The Poetry of Programming" http://java.sun.com/features/2002/11/gabriel_qa.html

Let me give you a chess analogy.

If you learn chess, there are a couple of theoretically known patterns like the king opposition in K+P endings, good-vs-bad bishop, etc. This corresponds to the good ol' "engineering knowledge". But you cannot just go ahead and try to blindly apply these principles in the real game. You need a lot of creativity to apply them, and more so even to discover these patterns in the game. The games where players like Botvinnik apply the "engineering principles" are not devoided of creativity. They are very creative, fascinating and very pedagogical. I like them since they make an impression that chess is actually very simple. But the most spectacular chess games are not these ones. The most spectacular games are those where players manage to get outside of the thinking mood of usual "engineering patterns", get out of the ordinary, and think different. This is the "artistic part" of chess playing. It goes hand-in-hand with the "engineering part"; the chess could not be diminished to either of these aspects.

To get back to Richard Gabriel's analogy, the usual advice to somebody learning chess is to study a book or two on the theory and patterns, but not to overdo it: one profits much more by playing a lot and by studying the games of Grandmasters. Which is exactly what Richard Gabriel says that people do when studying poetry. The art of chess looks closer to the art of poetry than to the art of bridge building. He argues that this is the case for the art of computer programming too, where the creativity and the diversity factor is often overlooked in profit of usual engineering mood. I cannot but subscribe to this plea for diversity and creativity. That's why I like the freedom and power of Lisp or Python and why I dislike the "narrow-mindedness" of Java's point of view. Freedom to think different is the path to really excellent chess games, excellent poems, and excellent programs!