The Flow – Programming in EcstasyPosted: February 10, 2011
I once worked in an office with a timed motion sensor light switch. If it didn’t detect motion in the office for 20 minutes or so it would turn off the lights.
When I was programming “In The Zone” the lights would switch off repeatedly and often over hours of work. Each time I’d flail my arms briefly to get the lights back and return to the task at hand, back into the zone. Eventually I would get the hint, switch my mind off, stretch and go home to wife and kids.
I enjoyed being in the zone… greatly. I lost track of time. I lost awareness of my surrounds. I was detached from everything around me and was immersed in my task. It felt great but strangely I wasn’t really aware of that feeling when in the zone.
I’m confident, but not certain, that my programming work done in the zone was better. I was able to tackle the most complex tasks more successfully. I felt more productive — I don’t remember ever leaving the zone and looking back at my work as being poor.
Programming in the zone — or “The Flow” as it is known in psychology — deserves better understanding. Why? Because many developers share this experience and rage against environments that don’t support their desire to work in the zone.
Research backs my experience of hyper-productivity, suggesting that “achieving a flow state is positively correlated with optimal performance in the fields of artistic and scientific creativity” and that “flow is positively correlated with a higher subsequent motivation to perform and to perform well”. Those seem like good reason to facilitate working in the flow!
What are the distractions? Open plan offices, interruptions for meetings, talkative colleagues, slow equipment, IM, Twitter, iTunes, email and much more.
What are some other inhibitors? Working on tasks outside your competence; lack of confidence in your own ability to tackle a task; lack of a clear direction for work.
Psychologists on The Flow
I wanted to understand the experience better and I found taking a step into the psychology of the flow fascinating and helpful. The Flow seems a well-studied area and I found that psychology has insights that shed light on this programming experience.
Prof. Mihály Csíkszentmihályi coined the term “the flow”. From his bio:
Mihály Csíkszentmihályi says creativity is a central source of meaning in our lives. A leading researcher in positive psychology, he has devoted his life to studying what makes people truly happy: “When we are involved in creativity, we feel that we are living more fully than during the rest of life.” He is the architect of the notion of “flow” — the creative moment when a person is completely involved in an activity for its own sake.
In it he talks about his life experiences that brought him first to the field of psychology then to the study of happiness. He explored how poets, composers, mathematicians and others described a state of effortless spontaneous creative flow; hence “the flow“.
During his speech he quotes an unnamed American composer. The composer’s words described my experience as a programmer in the zone better than I ever could.
“You are in an ecstatic state to such a point that you feel as though you almost don’t exist. I have experienced this time and again. My hand seems devoid of myself, and I have nothing to do with what is happening. I just sit there watching it in a state of awe and wonderment. And [the music] just flows out of itself.”
Hollywood movies, the source of wisdom and enlightenment for modern mankind, have also explored the effortlessness of The Flow:
Morpheus to Neo in The Matrix: “You’re faster than this. Don’t think you are, know you are. Come on. Stop trying to hit me and hit me.”
Yoda in The Empire Strikes Back: “Try not. Do .. or do not. There is no try.”
… but I diverge.
Can Programming be Ecstasy?
I had never thought of programming in the zone as being in an ecstatic state. I’d always associated ecstasy with spiritual or drug-induced experiences. But my experience fits the definition of ecstasy. Definitions include: “sense of being taken out of one’s normal state”, “trance-like dissociation”, “intense feeling”, “poetic inspiration”.
Ecstasy is a subjective experience of total involvement of the subject, with an object of his or her awareness. Because total involvement with an object of our interest is not our ordinary experience since we are ordinarily aware also of other objects, the ecstasy is an example of altered state of consciousness characterized by diminished awareness of other objects or total lack of the awareness of surroundings and everything around the object. For instance, if one is concentrating on a physical task, then one might cease to be aware of any intellectual thoughts. On the other hand, making a spirit journey in an ecstatic trance involves the cessation of voluntary bodily movement.
This aligned with my personal experience of programming in the zone: total involvement, diminished awareness of surroundings, trance-like, cessation of bodily movement.
As Mihály explains the experience of the composer;
“he achieves ecstasy with only a paper and pencil, … can imagine sounds that never existed before, … [has] an intense experience as if he didn’t exist; his body disappears … his identity disappears from his consciousness”.
To paraphrase as a programmer:
“I experience ecstasy with only a screen and keyboard, I create programming solutions for challenging problems that never existed before. The experience is as if I didn’t exist; my body disappears … my identity disappears from my consciousness.”
The experience of programming in the zone for me was tremendously satisfying, relaxing and (I believe) hyper-productive. It was not an everyday experience. It could not be planned or scheduled. I could not force myself into the state.
The flip side is that once in the zone I was lost to the world — to my wife, my kids, my colleagues, disregarding my appetite and more. I could easily miss meetings or lunch or dinner or exercise.
Mihály goes on to cite the experiences of the flow from many fields: poets when writing, mathematicians, Einstein when pondering relativity, sportspeople including figure skaters, CEOs and others.
I’m not about to declare programming as a path to enlightenment or spiritual awakening (at least not for myself). I can’t say whether my experience of programming in the zone is anything like others’ experiences of The Flow or other ecstatic states. I would like to hear from anybody who has experienced both programming ecstasy and the same state in another sphere of life. How do they compare?
Still, I do think that the work of Mihály and others can shed light on the programmer’s experience and how to encourage the practical and emotional benefits I found when working in the flow.
While I could not plan to work in the zone I think it is possible to create a setting that makes it easier to achieve the state: the engineering of ecstasy.
Sony’s co-founder, Masaru Ibuka, codified its Purposes of Incorporation including the following statement. [I couldn’t find this at Sony’s site but it is quoted by Mihály and elsewhere on the web; e.g. here.]
“To establish a place of work where engineers can feel the joy of technological innovation, be aware of their mission to society, and work to their heart’s content.”
I think that programming in environments that allow or even encourage programmers to enter The Flow could make the difference between a productive environment and a hyper-productive environment or between satisfying and deeply rewarding. The hyper-growth of Sony and the select group of recent tech winners (insert your favorite) may in part be due to their ability to create an environment for programmers and other staff.
How does study of The Flow by Mihály and others shed light on programming? Mihály goes on to discuss “How It Feels to be in the Flow?” and in the process he sets out the precursors and contributors to the flow with all being important.
1. Competence: you must have sufficient skill and experience to tackle the task at hand.
2. Self-confidence: belief in your own ability to perform the task.
3. Direction: a sufficiently defined task and the capacity to navigate towards the end.
4. Ability to concentrate: reduce distractions.
5. Serenity: the absence of worries.
Achieving the flow should not be about perfection of the working environment. If small distractions affect somebody then perhaps they wouldn’t be able to reach the zone anyway. If a task is not challenging enough for somebody (their competence exceeds the challenge) then they can still enjoy the task and tackle it effectively with a sense of control. If, conversely, the challenge somewhat exceeds their competence then it can be a stimulating experience and potentially accelerate learning.
Whatever the circumstance, thinking about these five dimensions is helpful before undertaking major tasks.
Andrew H – Psygrammer
… As an aside: my wife called while I was researching and writing this post. I had lost a couple of hours in my sense of time. Perhaps I was in the zone?