Principles of Software Flow

Achieving Flow

This is a file from the Wikimedia Commons.To achieve flow is to be happy. Some developers call it ‘the zone‘, others ‘hack mode,’ but all agree that it is the best place to be when writing code. It isn’t unique to Software Development. Getting things Done author David Allen borrows a simile from karate to describe it: “Mind Like Water“.

In his classic book ‘Flow – The psychology of Optimal ExperienceMihály Csíkszentmihályi describes the state of flow in great detail.

It is what the sailor holding a tight course feels when the wind whips through her hair, when the boat lunges through the waves like a colt – sails, hull, wind, and sea humming a harmony that vibrates in the sailor’s veins. It is what a painter feels when the colors on the canvas begin to set up a magnetic tension with each other., and a new thing, a living form, takes shape in front of the astonished creator.”


As a programmer I can relate to the painter’s experience. When I spend the day in my text editor writing code: moving from green bar to green bar, filling files with text and re-factoring complex structures into something clean and simple. The time flows by and I’m shocked to discover when I’ve run out of day.

Flow can be achieved by teams working together as well as individuals.  Surgeon Atul Gwande recounts an experience of a team achieving flow as they raced to save a patients life.  The clock was ticking and the patient’s chances of survival were reduced with every passing the second.  The assembled team had never worked together before and the patient’s life depended upon them coming together as a team.

They were swift, methodical, and in sync.  The case was far from easy, but for whatever reason, it seemed like nothing could thwart us….  Steve, thinking ahead, asked Jay to grab a retractor we needed.  Joaquim nudged me to make the abdominal incision bigger, and stayed with me at every step….  Because we worked as a single unit, not as separate technicians, the man survived….  The operation had been symphonic, a thing of orchestral beauty….  From the moment we six were all dropped together into this particular case, things clicked.  It had been almost criminally enjoyable.

The Checklist Manifesto

It may be possible for small teams of highly trained medical professionals to achieve flow in the well resourced operating theatre, but what about more realistic jobs. Can the factory worker achieve flow?   A recent episode of This American Life shows that they can.

The experience of General Motors and Toyota at the NUMMI plant in Freemont, California suggests that they can.  Episode 403 of This American Life tells the story.  General Motor’s  workers enjoyed a level of pay and benefits they could not achieve working anywhere else.    The job for life it provided was a gilded cage because the work itself gave no satisfaction.

The way the plant was organised made it hard for them to achieve flow, so they sought happiness elsewhere, even in drinking, gambling, prostitution and drugs.  Management just wanted them to do there job, and yet they could fail to do even that. Absenteeism was high and one worker deliberately sabotaged the cars.  With the power of the union they thought there jobs were safe no matter how badly they behaved.  They were wrong.  The plant was closed in 1982.

In 1984 the plant was reopened as part of a joint venture between General Motors and Toyota.  Most of the same workforce were sent to Japan to learn the Toyota Production System.  The Toyota Production System introduces flow to the production line based on it’s two fundamental principles: Continuous Improvement and Respect for People.  Following these principles allows not only supplies and materials to flow, it also allows the people on the production line to achieve a state of flow where they are challenged but not overburdened.

The workers were proud of the Chevy Nova they were building. One worker would leave postcards with his name and address under the wiper of Nova’s he saw around, asking the owners to drop him a line. Another worker would go to the Chevy dealership to stare at the Nova’s just sitting there on the lot.

It may be nice that the employees were happy in there work, but surely car factories exist to generate profit by making cars, not keep the workforce happy.  What were the benefits for General Motors?  Plenty: within three months the same plant with the same workers achieved near perfect quality at a much reduced cost. It was estimated that it would have taken 50% more workers under the old system to produce the same car.

Nummi may have closed and Toyata may be experiencing problems right now, but in Nummi they were able to prove that a large, industrialised workforce can achieve flow.  General Motors also discovered the huge commercial benefits of allowing the workforce to achieve flow.

NUMMI plant in Fremont with Mission Peak behind it. (Joint venture between General Motors and Toyota.

I work in Software Development and I wan’t to achieve flow. I want the end users of the applications that I help to create to achieve flow.  I want the business analysts and the testers and the help desk and the project managers to all achieve flow. In ten years time I want the maintenance programmers extending the code base to be achieving flow as they implement their change requests.

Is this an unrealistic goal?   I hope not.   Is there some amazing secret that has to be uncovered before it is possible? No, because none of these principles are new. They really just seem to be common sense once they are being followed.  The unfathomable thing is why everybody isn’t doing this already.  The second half of the This American Life episode provies a clue when it talks about General Motor’s failure to replicate what had happened at Nummi.   They would take pictures of every inch of the Nummi plant, and then ensure that another plant looked exactly the same. In every aspect they did things exactly the same way, and yet they failed to replicate the success. Why didn’t it work?

Csikszentmihalyi  explains the problem:

It would be erroneous to expect that if all jobs were constructed like games, everyone would enjoy them. Even the most favorable external conditions do not guarantee that a person will be in flow. Because optimal experience depends on a subjective evaluation of what the possibilities for action are, and of one’s own capabilities, it happens quite often than an individual will be discontented even with a potentially great job.


If Flow comes from within and the external conditions needed to achieve it are unique to each individual then copying the external environment will not copy the flow state. In each place the worker must be able to find what they need to achieve flow.  However, the Toyota Production System and the experience of Atul Gawande seem to contradict this idea. At Toyota work is standardised, with every activity scripted to the finest point of detail. Gawande found the use of a standard checklist helped even the finest surgical teams to find flow and avoid mistakes.

In this blog I will make my own personal attempt to understand these contradictions, evaluating the conflicting claims and attempting to untangle the apparent paradoxes. My goal is to produce the best software I possibly can, and I believe learning how to achieve flow in software development is the best way to achieve that goal.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: