Better Coding… By Doing More Ironing

Have you ever had that moment when you've been racking your brains on a really gnarly problem with no solution in sight… and then the answer smacks you in the face while you’re organising your collection of 1990’s indie music CDs?

Occurrences of this common phenomenon been recorded throughout history, with some notable examples:

Mathematician René Descartes reportedly devised the Cartesian coordinate system whilst watching a fly crawl on the ceiling above him[1].

More famously, Isaac Newton was inspired to formulate his theory of gravity while observing the fall of an apple from a tree[2].

I wanted to understand a little more about why this happens, and harness the power of solving problems without thinking about them.

Inspired by distraction

A paper published in 2013 lead by Benjamin Baird and Jonathan Schooler of the University of California[3] found that when faced with a creativity task, periods of time spent performing an undemanding task maximises mind wandering (when compared to a demanding task, a rest or no break at all).

This time spent mind wandering lead to a substantial improvement in performance when subjects were switched back onto the creativity task.

The brick test

In the study 140 participants were given 2 minutes to list as many uses they could think of for a given item (for example a household brick).

After completing the test the participant was given 12 minutes to spend on one the of four activities:

  • Demanding task - When given a series of randomly generated digits from 0-9, was the previous number odd or even?
  • Undemanding task - When given a series of randomly generated digits from 0-9, is each number odd or even?
  • Rest
  • No rest

After the activity was completed, the subject took the creativity test again, with either a new target item or the same item. The percentage improvement on the test was then calculated, and the subjects then filled in a retrospective questionnaire.

8140587512 8D2D4C664B

Mind wandering

Participants that undertook the undemanding task and were retested with the same item recorded a significantly greater improvement in the creativity task than those who undertook the demanding task.

Undemanding task participants also reported a significantly greater mind wandering those who took part in the demanding task (a daydreaming frequency was calculated for participant using the retrospective questionnaire).


It seems that not all tasks are created equal when it concerns mind-wandering and creativity. Mundane tasks appear to foster increased levels of the mind wandering that lead us increased creativity.

So how can we use this to our advantage as programmers?

Perhaps when knowing we have a tricky problem to wrestle with at the heart of a set of changes, we can tackle more mundane infrastructure and boiler-plate code first?

And next time I'm burning a hole through my monitor at the end of the day thinking about how to approach that tricky algorithm...

I’ll go home and do the ironing.


[1] Descartes and the fly: [2] Newton and the apple: [3] Inspired by Distraction:

This site uses cookies. Continue to use the site as normal if you are happy with this, or read more about cookies and how to manage them.