Font Awesome Free 5.13.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
Skip to main content

Hammock-driven development

Sometimes, the best thing you can do for your code is to stop thinking about it - at least consciously

Basic idea

Sometimes, the best thing you can do for your code is to stop thinking about it - at least consciously.

Research has shown that different parts of our brain work differently, are triggered at different times and and are good at different kinds of things. When solving a problem (which is what software development essentially boils down to), it can help to combine the efforts of different parts of your brain and let them help each other solve the problem at hand.

The conscious and subconscious mind

Conscious mind:

  • Left part of your brain
  • Good at analysis and logic, solving problems using structured approach
  • Not good at seeing bigger picture, seeing alternative paths, ...

Subconscious mind:

  • Right part of your brain
  • Not good at analysis and logic
  • Good at seeing the bigger picture, seeing the forest through the trees, making connections between things that may not seem related at first sight
  • Works on problems when you're not consciously thinking about them
    • Solutions seem to come out of nowhere because you don't consciously realize your mind is still working on the problem

Feeding the subconscious mind

The subconscious mind needs something to start from -> need to fill brain with information about the problem you're trying to solve

Best way to feed subconscious mind: use conscious mind!

  • Clearly state the problem, ideally in written form
  • Identify things you know, identify things you know you don’t know, identify constraints that limit your possibilities
  • Look for related problems and proven solutions that have been used to solve them and analyze their benefits and drawbacks
  • Try to find or come up with different potential approaches and compare them to each other, seeing where each approach shines and where it falls short
  • Identify knowledge gaps to fill, mismatches you see, ...
  • Look at all of this regularly so your brain can absorb all of its information

Triggering the subconscious mind

One important thing about the subconscious mind: it is subconscious. This means that you cannot consciously force it to think about a certain problem. However, there are some things you can do to increase the chances that the right side of your brain will start working on the problem.

Tell your subconscious the problem is important

You need to think hard enough, your really need to work on the problem, in order to get to the point where the problem seems important enough to your brain to keep on working on it in the background.

Ideally, the problem becomes the "top idea" in your mind, the first topic that your subconscious starts working on when it gets the chance.

Stop consciously thinking about the problem

One approach: frustration

  • Work conscious brain to the point it gives up on finding any solution at all
  • This sometimes triggers the subconscious very quickly, probably because the frustration signals that the problem is a real priority
    • Sometimes, you suddenly think of a great solution almost immediately after you’ve given up

More pleasant approach: relaxation

  • Take a nap
  • Go for a walk or bike ride
  • Take a nice bath or shower
  • Drive along a route you know well
  • Mundane tasks: folding laundry, going to the toilet, brushing teeth, ...
    • Something that keeps your conscious mind occupied (preventing it from thinking about your problem) but doesn’t use up all of your brain’s resources
    • Research has shown that these kinds of undemanding tasks are very good at triggering your subconscious mind
  • Sleep on it

Note: "false relaxation", like mindlessly scrolling through stuff on your phone, will likely not work. This distracts you from the main problem, but also keeps providing new impulses for your mind to process. That way, you leave no room for the subconscious to really work its magic.

Processing the results

  • Capture the solution
    • Solution may be related to a problem you're currently not interested in anymore
  • Use conscious mind to analyze the solution
    • Compare to other solutions
    • Check if it violates some constraints you saw
    • ...
  • Even if solution is not great, it might still give you some new ideas or insights

Bonus: the power of interactions and the outsider effect

  • Other people can provide additional input, generate new ideas or offer a different point of view
  • Those people don't even have to know about the problem
    • Just talking to any person (or a rubber duck) can help you see things in a new light or expose flaws in your current approach
    • Sometimes, the best ideas for novel approaches come from people who don’t have that much relevant knowledge or experience
      • They tend to choose approaches that are different from the ones experts think of
      • Easy to think outside the box if you have no idea what the box looks like
      • This is called the "outsider effect"

Resources