Why is Programming Fun?  

Programming is tough, so why do some people develop a passion for it?

There are many views of this question. Here are a few answers. The explanations appear very different. They are presented in very different styles.

It is wise to take each point of view with a large grain of salt, while appreciating the internal coherence of these essays, and sometimes their elegance of expression.

View 1: The Raw Fact of Programming Happiness

In The Joy of Hex -or- Why I'm So Happy When I Program, Jim Neil does not attempt to generalise. He simply tells how he came to be engrossed with programming.

The story is well told and is a good example of how people get addicted to the craft. The reason given for the attraction of programming is given quite simply:
it's   "the total control and the logic of it all ".

View 2:  Programming is Fun Because it is Creative

Fred Brooks wrote The Mythical Man-Month in 1975. The book has remained on the reading list of Computer-Science or Software Engineering degrees ever since. It presents the realities of large software projects in an inimitable style. The paragraph that sums up Brooks point of view of why programming is fun is reproduced below. Follow this link for a one-page extract and links to the publisher.

"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. (...)
Yet the program construct, unlike the poet's words, is real in the sense that it moves and works, producing visible outputs separately 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.

View 3:  Psycho-Sociological Analysis

Alan Carter and Colston Sanger in The Programmers' Stone express a point of view of software engineers practicing in the IT industry. They describe what they observe in the population of professional software developers:

There are two kinds of people: "mappers" and "packers". Mappers are inventive, alert people, and very productive as programmers. They enjoy programming. Packers do everything by rote, following procedures laid down in manuals. They kill the fun in programming. Mappers are one or two order of magnitude more productive than packers. Packers are singled out as the root cause of the "software crisis".

> We all start up as mappers, but for many of us the aptitude is destroyed, often at an early age by boredom. Those of us so affected become packers, "ritual junkies", addicted to following sterile me-tho-do-lo-gies, afraid of change, and of imaginative solutions.

> The "mapping" process is not analysed in detail, but it is said to involve "exploring the details of our desires, and understanding them in such a way that we can keep track of all the complexity".

> So in the end, why is programming fun?..

because  "programming is as near to pure mapping as you can get outside your skull. This is why it is fun. It is endless discovery, understanding and learning ".

The software engineering practice of  "Extreme Programming" (XP) is seen as an attempt to restore the fun of "mapping" to software development. XP claims to be a lightweight, efficient, low-risk, flexible, predictable, scientific, and fun way to develop software. (See http://www.extremeprogramming.org/)

View 4: Programming and "Flow"

Programming is an intensely focused activity. The sense of time and self seems to vanish. When, despite the difficulty of the task, it is accompanied with the sense of being in control, the experience can be described a manifestation of the phenomenon of "flow".

This is a very intense and enjoyable experience which can can give sense and direction to one's life. It was first described by Mihaly Csikszentmihalyi in the book "Flow: The Psychology of Optimal Experience", HarperCollins (1991).

A frequent quote from the book reads:

"We have all experienced times when, instead of being buffeted by anonymous forces, we do feel in control of our actions, masters of our own fate. On the rare occasions that it happens, we feel a sense of exhilaration, a deep sense of enjoyment that is long cherished and that becomes a landmark in memory for what life should be like. This is what we mean by optimal experience."

The characteristic of the flow optimal experience are given as:

  • a sense of playfulness
  • a feeling of being in control
  • concentration and highly focused attention
  • mental enjoyment of the activity for its own sake
  • a distorted sense of time
  • a match between the challenge at hand and one's skills

The last characteristic is important: The task must be at the limit of one's capabilities. Too easy, and boredom ensues rather than flow. Too difficult, and anxiety is the result instead.

Programmers are understood to be sharing this optimal experience of "flow" with artists, rock-climbers, musicians, surgeons, athletes and others.

Many programmers would recognise the above characteristics of flow as part of their programming life. Repeated experiences of flow can shape one's personality, provide a purpose, and a sense of stability and accomplishment. 

More excerpts from the book, and information on flow can be found at http://www.debateit.net/improvethought/flow1.htm

View 5: Programming and Dopamine

The "flow" idea above has been accompanied by some extreme corollaries with a tendency towards mysticism. In the late 1990s the "movement" had taken cultish overtones. Not surprisingly this resulted in some sharp criticism of the psychological analysis employed by Csikszentmihalyi and followers.

Dr. Mezmer's page at http://www.homestead.com/flowstate/files/zflowlousy.htm offers a hilarious criticism the above view of flow.

It explains that flow is not a mystical phenomenon. Instead it is "a high state of attention, the conscious and unconscious processing of a massive amount of information relating to the accomplishment of a task, and the often profound state of relaxation and pleasurable alertness that occurs to further fix an individual to the task at hand and otherwise optimize cognitive efficiency. (...) The non-conscious processes that occur to optimize cognitive performance feel very, very good, but are also unfortunately very, very rare."

The pleasure of "flow" is presented as dopamine release in the brain: "in the last five years, research in the neuro-physiology of attention has discovered that whenever attention 'shifts' to cognitive precept or perception, the neuro-chemical dopamine is released that not only 'fixes' attention, but rewards the individual for paying attention. (...) in certain situations that impel an individual to rapidly shift attention to a host of salient or important precepts (e.g. creative activity, gambling, sports), the release of dopamine is sustained, with the result that the individual reports a subjective state of ecstasy, pleasure, and bliss."

Flow is a useful metaphor, but viewing it as an "elevated state of consciousness" is mere poetry. From the point of view of neuro-psychology, according to Dr Mezmer "flow does not exist ".

So that's it...
     Programmers are dopamine junkies. It's as simple as that.

More about Dr Mezmer (aka A.J. Marr) on http://drmezmer.com

What do I think about it?

I love the act of giving virtual life to abstract ideas as expressed so poetically above  in "The Mythical Man-Month". I enjoy the dopamine rush of success when a software dream of extreme complexity comes to life. It accompanies the pleasure of feeling that I can achieve quite difficult intellectual tasks. I enjoy pushing back the limits; I enjoy tackling ever higher levels of complexity. I also love giving out simple programs that work and are useful. There is pride and joy in giving the fruit of one's labour, be it a program working like clockwork, or a perfectly baked cake. I hope I'll be able to keep on dealing with the challenges of software complexity to a ripe old age.

I also think that there is a danger of addiction to these pleasures. Programming involves an extraordinary amount of mind energy, and time simply disappears. If we spend a huge amount of time programming, very specialised skills develop, but other aspects of our humanity may weaken over time. I did not always realise this, and for a while, caught in "flow", I abused that drug. Now I devote more time to enjoying the more organic pleasures of life, love, art and nature. I hope I have restored a healthier balance.

I find disagreeable and dangerous a vision of the programming world divided into "packers" and "mappers" as presented in the "Programmer's Stone". It turns a mismanagement issue into an ego trip. The frustration of being constrained by imposed structures that restrict our productivity and our pleasure is turned into the feeling that we belong to a small elite of achievers surrounded by a sea of no-hopers.
This distorted view leads to scorn, arrogance, bigotry. It's a dead end. To many young males of the species who are answering the genetically programmed urge to demonstrate their worth, it is unfortunately a seductive idea.

Modified: August 2004   Maintained by: cutter@codecutter.net