The Ultimate Guide to Meditation for Programmers

You can get a PDF copy of this guide by simply filling in this form – I’ll send it direct to your mailbox! I’ll send you follow-up emails to check in later on, as well as other awesome content about mindfulness as programming.

Meditation, programming and YOU!

If you’re a programmer or write code in any part of your professional or personal life, this guide is aimed squarely at you. It’s based on some simple premises:

  • You use your mind to write code;
  • All skills and capabilities can be improved with training – you have already done this many times in your life;
  • It’s possible to train certain capabilities of your mind – in particular, concentration, and the ability to be aware of, and alter, your mental state – which will help you become a more confident, capable coder.

The main method of mind training I explain in this guide is commonly referred to as “meditation”, although you might find it helpful to think of it as “attention regulation training” – that’s basically what it is. The capacity to focus your attention is, I’m sure you’ll agree, crucial to outputting quality code, so it’s in your interest to train it.

Why programmers benefit from meditation

Consider these scenarios. If you’ve been working with code for any length of time, you might have encountered any of these.

Scenario 1

You just can’t figure out what’s causing this bug. Countless hours of Googling, numerous Stackoverflow blind alleys, every reverse engineering trick you can think of, every single package removed and reinstalled, one by one – this thing still won’t work.

You start to think you’re not cut out for this coding life. It’s frustrating and you feel like a fraud – surely your co-workers will figure out you’re just a dumb impostor any minute now. It’s a lonely place, and fear piles on frustration – fear that you’re out of your depth, that you’ll never be any good at this.

What good will mastering this technology do anyways? There will just be another one to learn, it’s impossible to learn. You’re just running to stand still.

Scenario 2

It’s retro time. You’re sitting in the meeting area, waiting for your demo, palms sweating, fearful of what’s to come. You hate showing your work. What if they don’t get it? What if it doesn’t work? What if your voice breaks? Will you be able to answer their questions? They’re a demanding crowd, asking so much all the time, it’s relentless. Why do they keep asking so much of you?

Scenario 3

You arrive home after another long day at the code mines. While you definitely made some progress, you’re finding it hard to shake off the day. That one problem you couldn’t solve is going around in your head. It’s hard to think of anything else – when you close your eyes, you can just see code. The clack of the keyboard has burrowed its way into your mind.

There’s a steel rod where your shoulders should be, and when you try to sleep, the buzzing of your mind keeps you awake. Tomorrow doesn’t sound like much fun right now, although it might be better if you could just get some sleep…

Or these quotes, taken from several regular programmers who I spoke to while compiling this guide:

“I study coding and work as a programmer on my startup. Meditation helps me when I’m feeling overwhelmed and overloaded with information. It’s silence away from the noise of other humans, online courses, podcasts – a chance to let me brain rest for a while and just stop working”

“Meditation relieves the CRAZY amount of stress I find myself under and once I’ve released some of that stress it re-energises me – often it’ll help me get to sleep if I can’t drift off and all I can see is code behind my eyelids”

“Breathing meditation helps be come back into the present. I’m doing exams for my programming courses in university right now and meditation brings me almost immediate calm when I need it most”

“Sometimes my mind makes the challenges of writing code bigger and scarier than they actually are. When I meditate, it’s like the problems come back down to actual size and I realise that they aren’t actually that big – it’s a perspective shifting tool”

“Sometimes when I’m frustrated I can be a real asshole to my colleagues and family. This doesn’t do anyone any good. Meditation helps me to make peace with my circumstances so I don’t take it out on others. I feel more emotionally balanced, and I’m able to focus on the code instead – which is what I’m really here to do”

There are several big reasons to meditate if you spend any time writing code:

  • Meditation helps you stay focused and effective by training you to work with with inner and outer distractions;
  • Meditation mitigates the effects of stress by teaching you how to relax;
  • Meditation helps with FOMO (fear of missing out – for example, being left behind because you don’t know everything about latest, greatest, all conquering Javascript framework) and impostor syndrome (“I’ll never know enough to not be a fraud; I need to work super hard to be considered barely competent”) by teaching you to be present to your current experience and capabilities rather than unnecessarily dwelling in the past or future (sound familiar?);
  • Meditation helps you deal with unhelpful, reactive emotions like frustration and anger;
  • Meditation helps with creativity and problem solving.

Meditation as focus training
Anybody who has ever written any code knows it requires focus. Getting knocked out of flow can ruin your productivity. But distractions are real and have a huge negative impact on getting things done.

A programmer can take ten to fifteen minutes to start editing code after an interruption [link]. By learning to recognise the distracted or interrupted state, it is possible to get yourself back on track more quickly.

Distractions come in two forms – external and internal. External distractions are to do with other people and the world around you; internal distractions to do with your own inner world – the world of thoughts and emotions.

Meditation helps you to work with distractions in two ways:

  • You generally become less agitated and more able to cope with external distractions in a non-reactive way
  • You learn how to navigate your own inner distractions of frustration, fear, anger and not-feeling-good-enough by learning how to observe when they are taking you out of focus, so you can bring yourself back on task.

Meditation as stress relief
The stress response is a response in the body-mind system in relation to a perceived threat. I wrote a long, detailed article about stress here.

The short version is – while a little stress isn’t harmful and can even be beneficial, chronic, long-term stress is a productivity killer and really not good for your long-term health, or how you feel about the world in general.

Some of the strongest scientific research into meditation supports its effectiveness as an antidote to stress.

Meditation trains you to be present
The most important moment in your life is the one that you are living right now. The past is done, the future is uncertain and hasn’t quite appeared yet.

Our mind, however, often feels it would like to be anywhere BUT the present moment.

We’re constantly wishing we were somewhere else or someone else. We dream of futures where we have all the answers; or that we are the World’s Greatest Coder (I’m still waiting for my medal!). We remember easier times, or harder times, or any time that isn’t right now.

While the desire for improvement that this creates can be beneficial when it comes to providing momentum to improve our lives, when we’re caught up in this type of future or past oriented thinking, we’re missing out on all the goodness of the life that we’re living right now.

Us coders are lucky, in that the vast majority of us LOVE writing code. But we are still subjected to that nagging feeling that things will be better IN THE FUTURE or things were better in the past.

For example, the nagging feeling of being an impostor – that somehow, the current version of ourselves is somehow not good enough, that we’ll be found out as not having the right skills, that our knowledge is incomplete.

In either case, we wish for a future version of ourselves that will be better, rather than focussing on how amazing we actually are right now. Which means we’re missing out on that most important moment – right now.

For most of us, there are AMAZING aspects of our current situations that we’re missing out on by just not paying attention, or by giving these not-now thoughts way too much value!

Furthermore, a good programmer is deeply in touch with the ability to spot potential problems. The capacity to anticipate issues is a strength when applied judiciously – but humans are already up against a negativity bias – where about 80% of our idle mental effort goes towards pondering negative situations.

At worst, the thinking mind of a programmer can become problem saturated, leaving no time or space for joy or fun or ease. Which is no way to live!

By teaching us to be present, meditation allows us to savour and enjoy the life that we are actually living rather than the imaginary life our mind is constantly creating or fearing. The moment by moment experience you are currently having becomes richer, more detailed and more meaningful.

Your interactions with friends and colleagues can become lighter. Your capacity to stay calm under pressure. Your ability to show up for this life, lived right now, in this moment, is enhanced.

Why are you reading this guide?

I want to help you stay on track here. Something got you to click on the link and start reading this guide.

It might be that you have some difficulty that is getting in the way of you being able to write code.

Perhaps that difficulty has been there for a long time, perhaps it’s more recent.

Often it’s related to difficulties focusing, which in a large number of cases is to do with excessive stress.

Perhaps the code is flowing from your fingertips, and you want to keep it that way. You’ve had periods of struggle before and are curious about how they might be avoided or minimised.

Or it might be that you are already smashing it in life, but want to level up in some way.

It might be plain old curiosity. Perhaps someone you trust told you that meditation would be useful to you.

Whatever it is, make a mental note of it right now. Perhaps write it down on a piece of paper. Keep it somewhere you can see it. Whatever you take from reading this and trying out some of the techniques, you’ll be able to assess whether it has been useful for you.

If it’s useful, keep doing it. If it’s not immediately useful, stick with it before making your mind up completely – most good things take a little time to figure out.

Do this now

To give you a flavour of what to expect in this guide, take a few minutes to do the short exercise in this video.

How do you feel now? What do you notice about your breath, your mind and your body? Many people report feeling calmer and more focussed after just a few minutes of this type of breathing.

Why I wrote this guide

My mind has malfunctioned in spectacular fashion on a number of occasions (thankfully, and mostly thanks to the techniques I describe here, not for a while!).

It’s hard to write code with a malfunctioning mind.

For me, those periods of malfunction were the result of excessive stress in my life. They showed up as the symptoms of extreme anxiety – a constant worry I wasn’t good enough, fear about the future, muddled, excessive thinking, insomnia and so on.

If this sounds like you, there’s a good chance that some of the stuff here might be able to help. I’m not a therapist though, so if you suspect some deep underlying mental health stuff, seek one out – I’ve done it several times and am a better human because of it. No shame. Please email me if you want help with this –

I’ve navigated my way out of those malfunctions several times. In fact, my life has improved in a few significant ways since those experiences.

I went from stressed, anxious and unfocused, unable to write code and barely able to do my job, to happy, light-hearted and focused, working on projects that I care about and with a newfound capability to deliver.

None of the tools I’ll explain here are complex or mystical. All are practical and require not much more than somewhere to sit quietly for a few minutes.

Programming, meditation and me

I got my first computer at the age of 10, a ZX Spectrum, in 1988 (yes, I’ve been around a while!).

I still remember coming down to the sitting room where my father had hooked it into the TV (imagine that!) on the morning of my birthday. I fell in love with its rubber keys and their mysterious symbols. I was enthralled by the ability of those keys to make stuff happen on the screen!

A teenage life of writing “choose your own adventure” games on my Atari ST and my friend’s Amigas was followed by the decision to study Physics at University. I had to code throughout, becoming expert in being terrible at C programming quite quickly. It was the early days of Google (I graduated in 2000) and the world of the web was widening in front of us.

I finished my degree, and instead of doing a PhD in Physics at Oxford, I decided I’d prefer not to be in a lab all my life, so I studied for a Masters in High Performance Computing (basically, what were called supercomputers, still used to do computational physics and other science stuff).

Five years at the University of Edinburgh building apps in science, as well as exploring the Grid (or what would become the Could… much better branding!) was followed by a segue into the commercial world, where I’ve mostly stayed ever since.

I’ve programmed commercially on both .NET and Java stacks, PHP and a number of its frameworks, all the fun front-end stuff (the recent explosion of JavaScript has been quite amusing – who knew?) and a heap of back end scalability (we just called them “Big Databases” before the whole big data thing came along…).

I’ve worked in investment banking and other financial services, online travel, property, digital agencies. I’ve done startups, corporates, consultancies. I’ve been coder, tech lead, head of development, agile coach, ScrumMaster and so on. I like to think I know a bit about code!

My mind came with me through all of these experiences. My mind kept me able to meet all the demands placed on me. I wish I’d learned to value it sooner!

Why I started learning meditation

Life is mysterious and wonderful and tragic. I’m not here to philosophise about that right now (well, maybe just a little) but – shit happens, and some of it’s bad.

When I was 27 I lost my father (he passed away from cancer), which, to say the least, was a BIT stressful. It actually made me completely anxious at times, which manifested in extreme hypochondria.

I literally thought everything was going to kill me (which is ironic, since the one thing that’s guaranteed about life is that, yes it will kill you eventually – so why worry? Ok no more philosophy…)

Someone important in my life at that time saw how anxious I was, and suggested I tried meditation. I was sceptical, for many reasons that I’ll address later, but I gave it a go. I used some guided audios by a guy called John Kabat-Zinn and had quite a bit of success (I stopped thinking I was going to die all the time for starters, which was pretty cool!).

I learned two things. If you leave this guide with nothing else, remember these:

  • There can be a BIG difference between the contents of your thought stream, and the reality of the world. It turns out you are NOT your thoughts and you can cultivate an attitude towards them where they stop being such a dominant, noisy pain the ass (but you can’t eliminate them, and you certainly don’t need to – we’ll talk about this later…)
  • A few minutes of attempting to focusing on your breath, slowing it down and feeling it in your body can give your nervous system the prompt that it needs to get out of anxiety mode, and just, you know, relax for a hot minute!

Why I started teaching meditation

I still find it amusing and curious that “meditation teacher” is a life role I hold. I’m extremely glad of it, because the value I’ve seen these simple practices create in people’s lives continues to amaze me.

I started teaching meditation for primarily selfish reasons! I had finally realised that my life was better when I meditated. I was more focused, clearer in my thinking, less emotionally reactive, felt more creative and I hit states of flow much more easily.

I had wondered for a LONG time how to make a meditation practice work for me. One day, I decided the best way force myself to show up for regular meditation practice was to set up a group in my office and play the teacher! If people were dependant on my being there, it was much more difficult for me to avoid meditating myself! And it worked….

I started being invited to speak about and guide meditation practices in different parts of my life. As I realised I was being lead down the teaching path, I deepened my own meditation practice with a series of retreats and trainings with a number of different teachers.

These days, I still spend a good chunk of my life building software systems. I work on my own meditation app. And I teach about ten public, drop-in guided meditation classes every week here in Sydney, Australia, as well as numerous private seminars, talks and other events for a variety of companies and organisations.

It’s a gift to live a life that allows me to share the benefits of meditation practice so regularly and with so many people. I see this guide as an offering to the wider coding community. Please enjoy!

Meditation myths exploded

Mediation is becoming quite a mainstream activity. Nevertheless, it carries some cultural baggage that I’d like to address.

Some of the commonly held views about meditation can put people off from trying, or are just not useful when actually learning how to meditate.

That baggage is slowly being shed. I’d like to address several of the common misconceptions held about meditation

The myth of the silent mind
A programmer’s most valuable tool is their mind. Being able to break down complex problem domains into deterministic steps that can be followed by general purpose computing machines is basically what we get paid for.

Thinking is non-optional for a programmer. Silencing the mind is not really an outcome we’re looking for in our programming careers.

I teach meditation to many people every week. Many people come to meditation seeking respite from an overactive, busy mind (often at 4am or just before bed…).

Most have the idea that meditation somehow means “stopping thinking” or silencing the mind, for the whole period of meditation.

Many new meditators quit at the first hurdle, because they have the experience of trying to meditate and feeling they have failed because their mind maintained some degree of activity during the process. (Has this happened you?)

Trying to stop yourself from thinking is really, really, difficult. Actually, it’s close to impossible for most of us. If I tell you right now not to think of, say, pink elephants, what do you find yourself thinking of? How hard is it to stop?

While it’s true that extended periods of mental quietude are a likely outcome of a dedicated meditation practice, it can be an obstacle to learning how to meditate to focus on this as an outcome. So drop that expectation now!

The good news is that there is no need to silence the mind to benefit from meditation – thoughts within meditation itself are not a bad thing at all. There is no need to stop your thoughts or for your mind to go blank, so if this is something that you have been concerned by with previous attempts to mediate, then you can safely drop this idea right now.

One of the side effects of meditation is that, with practice, you develop a better relationship with your thoughts. You become more adept at recognising useful and less useful thoughts.

Most people find that the intensity of thinking diminishes, thoughts can slow down and thinking becomes clearer – but it never needs to stop completely!

Some people treat meditation as a game of “stop all the thoughts” – a bit like whack-a-mole. That’s not a fun or useful game to play. The game we’re playing here is different. I explain a better way to approach meditation below, in the section on the Standard Meditation Algorithm.

You can get a PDF copy of this guide by simply filling in this form – I’ll send it direct to your mailbox! I’ll send you follow-up emails to check in later on, as well as other awesome content about mindfulness as programming.

Spirituality, religion and mysticism

I’ll put it out there early on – meditation practices are central to the mystical branches of most major religious practices in some form or another. However, meditation is a state of being accessible to all people regardless of their religious beliefs.

I actually think that it’s quite interesting that different cultures at different times have discovered practices that share really important characteristics. But it’s really not necessary to take on all that cultural baggage to benefit from meditation.

I’d like to make it clear from the start – my worldview is generally rationalist and scientific. For the most part, I embrace evidence-based practices and critical thinking.

I’m not a member of any spiritual or religious organisation. I have studied and worked in physics and computer science – I’m more likely to take a materialistic worldview than not in most situations.

Although I’ve dived deep into the philosophy and practices of Buddhism and yoga in particular, I approach each with a sceptical mind and have no patience for some of the more outlandish claims made by these and other spiritual paths.

That said, if you have an existing spiritual or religious path, it’s my opinion that you can safely blend meditative practices within your existing frameworks, if you are willing. Anyone can meditate regardless of whether they’ve been to a church, temple, mosque or any other place of worship recently, or indeed ever.

Modern meditation is a secular practice that is more concerned with getting to know more about yourself and how you operate in the world.

You can choose to embrace it as a tool for self-awareness and self-development, rather than needing to involve yourself in a grand quest for spiritual knowledge (although if that’s your aim, feel free to try it on too! But we won’t be getting into that in this guide).

How meditation makes you a better coder

There are three main ways that the skills I have learned in meditation directly apply to my coding activities. They are:

  • Increased focus through distraction management
  • Stress management through relaxation
  • Optimising experience through self-awareness

Increased focus
I lose focus all the time. This might sound strange coming from someone who has meditated for a good chunk of his life, but it’s true, and will continue to be true. But I still know that meditation has helped with my ability to stay concentrated on coding tasks for extended periods – which is bloody useful!

Like most humans, I find my mind off-task multiple times a day. There are a couple of major ways I find myself distracted when trying to cut some code.

  • Internal distractions, such as getting caught in a rabbit hole of thoughts or feelings – in particular frustration (sound familiar?), but also anger and shame;
  • Research distractions – a simple query of Stackoverflow turns into a full-blown YouTube binge or a reddit gravity well.

Mediation doesn’t mean I never get distracted. But learning to meditate has given me a better relationship with distraction. In general

  • I get distracted WAY less;
  • I notice it has happened FASTER than I used to, which means I waste less time;
  • I find it MUCH easier to direct myself back onto the task at hand.

All of this means I’m able to devote much more of my productive time to getting what I need to do, done!

Stress management
I’ve worked in some stressful jobs, and some less stressful jobs. The first job I had out of university I once worked a 21hour shift! I got rid of some bugs, but I definitely introduced some more.

Even in the best of environments, it’s possible to push the stress levels to uncomfortable levels from time to time.

There is no doubt – the foggy mind, elevated physical tension and emotional reactivity associated with the condition of excessive stress get in the way of writing solid code. We need to think clearly to code clearly!

Meditation has trained me to become aware of the subtle mental and physical indicators that tell me I’m on the verge of being over stressed. Conveniently, the practices themselves have taught me how to de-escalate my nervous system in a reliable and portable way.

Optimising experience
My overall experience of life has been enhanced and improved by my meditation practice because it has taught me self-awareness.

As a result of this continued study of my breath and my body, I’m more aware of my state of being on a moment by moment basis.

I can tell when I’m feeling anxious, or sad, or happy, or frustrated, or giddy, or distracted. Many times a day I remember to ask myself – how am I feeling right now?

Whatever it is that I’m feeling, I can evaluate whether that state is useful or not, and perhaps choose another way to be in the world. I can optimise my experience to suit the circumstance.

Say I’m pissed with a co-worker or client. Perhaps I notice that anger as a physical feeling of rage, and a desire to lash out.

Knowing this is powerful. I can make a call on how best to use that anger. Lashing out might not be the best thing to do – perhaps a more measured approach might serve my long-term interests better. Because I’m aware of my anger, I don’t have to be controlled by it.

Or I find myself frustrated and disheartened during a bug hunt (who hasn’t been there?). Instead of needlessly persisting or turning on my “inner critic” (you know the voice – the one that says you’ll never be able to fix it), I give myself a break and return to the problem refreshed, or talk to a teammate and we fix it in minutes.

Self-awareness leads to better decisions and a smoother experience of life. It’s a superpower!

How to meditate – the Standard Meditation Algorithm

Meditation utilises a fundamental capacity of the human mind – the capacity to direct the attention – to maintain awareness of the breath and/or the body for a sustained period.

Meditation is a deliberate, intentional act. To meditate, you decide that you will carve out some time from your day.

During meditation, you maintain a mental intention to remain aware of your breathing, or some aspect of the sensory world of your body, as best you can, for the period of meditation.

At the heart of every meditation practice is something I call the Standard Meditation Algorithm. If I were to write it down in code, meditation would look a bit like this (please ignore the potential infinite loop!).

At a high level, what you need to do is:

  • Set aside some time in your day to intentionally practice meditation – typically 10-25 minutes is about right;
  • Deliberately relax the body;
  • Direct your attention towards something – typically we use the breath, or the sensations coming from the body, but there are many other options – we’ll go into this in depth below;
  • Watch how the mind quite naturally resists staying focused (it’s crazy in there some days) – it WILL wander, this is 100% expected and you will notice it happening;
  • Restore your attention as the mind wanders – maybe ten times, maybe a hundred, maybe a thousand! The number really doesn’t matter – as long as you remember to redirect your attention back to your meditation from time to time you are meditating 100% correctly;
  • When you emerge from your session, check in with yourself and notice what’s emerged as a result.

Here is the most important thing that anyone will tell you about learning to meditate – it doesn’t really matter if it wanders, what matters is that you bring it back.

This is so important I’m going to say it again, this time in bold. It doesn’t really matter if your mind wanders – what matters is that you bring it back, gently, without self-reproach.

MANY people find this process relaxing, often finding that their focus has improved, or they feel mentally clearer (such important qualities of mind for a programmer).

You can try it right now. Close your eyes, relax your body deliberately with a few sighs or yawns and just focus on the next ten breaths you take – about a minute or so (you can count to yourself mentally).

Just feel where you notice each breath in the body, whether it’s fast or slow, deep or shallow, in the nose or in the belly.

Don’t worry about getting it right – treat it as an experiment. See how you feel after – perhaps even just a little more relaxed? Maybe, maybe not but be curious. Either way, you just meditated.

Once you’re done, you can check in with yourself and notice the effects. Remember I asked you about why you were reading this guide? Does how you are feeling now tie in with that goal?

This box contains maybe the most important thing you’ll ever learn about meditation, so pay attention.

This is very important – success in meditation is NOT ABOUT STOPPING MIND WANDERING. The mind will wander, that’s entirely natural and expected.

Meditation is much more about NOTICING THAT THE MIND HAS WANDERED and then, gently, restoring focus to the object of meditation itself.

If you do that ten times, great. If you do it a hundred times, great – you still have a 100% record of noticing distraction and getting back on track.

It’s a bit like driving a car – every so often you notice your trajectory and make a little course correction to stay on the road, nudging the steering wheel or altering your speed.

Except what you’re “steering” is your attention. It won’t always stay on your breath or body by itself, so you just gently nudge it back in that direction when you notice you’re off course.

Meditation, thoughts and the nervous system

A conundrum that modern humans face is that we have an ancient nervous system that is, in many ways, poorly adapted for the environment we live in today.

Because the mind has more sources of information to process than ever before, modern minds are in overdrive.

Pretty much every person I teach meditation too feels that their mind is busier than a typical mind! It’s a near-universal sensation.

Here’s one of the big reasons – the environment we live in has rapidly changed to be very different from the environment in which our minds evolved. Our brains are still adapting to the changes.

We receive so much input in the form of emails, social media, television, work and so on that it overloads our ability to process this information. The sensory input will get “stored up” in our minds and bodies for later processing.

Our minds race, we feel like we can’t think clearly, that we can’t keep up with the pace or see the clearest way forward. All because we are thinking excessively.

One of the biggest struggles most people have with meditation is excessive thinking. It’s easily solved by realising that:

  • Thoughts are never a problem in meditation;
  • We can change our relationship with our thoughts by recognising they are just “mental events” – happenings in our consciousness that we can give more, or less, attention as needed.

With a bit of time, the mind eventually “settles itself” – in fact, this is one of the main reasons people come to meditation in the first place!

How meditation helps excessive thinking

The nature of thinking
Have you ever considered why we have thoughts? As humans, we identify so heavily with our thinking that it’s possible to go through your entire life without wondering why this is the case!

Thinking is pretty amazing. I love being able to think. But it wasn’t until a number of years ago that I ever considered just why it is that I think, and why it seemed to get a bit out of hand on occasion.

From the point of view of evolutionary biology, the ability to think is an advantage that allows us to solve the problems we face in the world. This in turn allows us to ensure our survival as an individual and hence as a species.

According to evolutionary psychology, the mind and its subtleties are adaptations that help us to survive and thrive in our environment. Every feature of your mental world is an adaptation concerned at a basic level with keeping you alive.

The most obvious way that your mind does this is by giving you killer problem solving abilities. You have the superpower to think your way out of (and in to!) tricky situations. You can do this using the power of abstract thought that eludes most other species.

In times gone by, this might have been as simple as figuring out a safe way through a ravine to get to water or food at the other side.

In more recent times, we’ve applied our ability to think in ever more sophisticated ways – for example:

  • Carrying out calculations that allow planes to fly;
  • Figuring out how best to deploy the resources of a team in a company;
  • Planning major construction projects;
  • Attempting to understand the complexity of nature and the human body;
  • Developing the software that powers our favourite websites.

All of which further the existence of individuals and the species.

Thinking. Powerful stuff indeed!

The ability to think, when harnessed correctly, is a source of major benefits to humanity. But sometimes our capacity to plan, predict, calculate and create can work against us. Especially when it feels that that’s all we ever do!

Excessive thinking
Sometimes, traits that have evolved in one environment can become a little less effective when the environment changes. This is known as maladaptation. In certain circumstances, the thinking mind can behave in a maladaptive manner.

There are three features of our current world that make our mind go into overdrive:

  1. The type of threat we’re faced with is, for the most part, imaginary. The majority of us live safe lives, where problems like food, shelter and water are mostly solved. Yet our mind still desires to direct its problem solving capacity at something. It preoccupies itself with our day-to-day difficulties, which are usually not life threatening, and directs the full extent of its abilities at them, resulting in excessive thinking;
  2. We’re bombarded with way, way more information than in the past, so our thinking, problem solving mind (which LOVES information, and loves to process that information by creating thoughts) is overstimulated. This constant stimulation means we can magnify the severity of our problems, turning everyday situations into sources of stress and anxiety. We become overwhelmed with excessive thinking. Everything becomes a problem to be solved, or goal to be achieved. This can get pretty tiring;
  3. We don’t live in a way that our nervous system is unwound through physical activity as frequently. Excessive activation of the stress response causes tension to accumulate in the mind and body and we don’t give ourselves time and space to release it, leading to long-term accumulation of stress.

Thinking is just fine. Do as much as you need to, do it well, do it clearly.

Overthinking, on the other hand, is often a sign of stress. It’s frequently experienced as racing thoughts, worst-case scenarios, living completely inside your head, or negative self-talk (for example, I’m a terrible programmer – often manifesting as impostor syndrome).

Frequently, we’re thinking in terms of “should” or “must” or “have to”, putting enormous pressure on ourselves for things to be different from how they are now.

Which is no fun, and gets us nowhere!

Imaginary threats and information overload make us prone to overthinking. Since thinking is designed to solve problems, it can feel like EVERYTHING is a problem!

The mind, which evolved to solve the problem of how to keep us alive – to help us to ensure our safety – is doing anything but! In fact, it can feel like we’re constantly UNSAFE – even when, objectively, we’re perfectly secure!

Meditation and excessive thinking
The preoccupation with survival often means that our minds are caught up with the past and the future. Because it is so concerned with our survival, our mind likes to predict where threats will come from. It also likes to reflect on the past, analysing events to see what it might learn from them for next time something similar occurs.

You can easily verify by observation of your own mind. Take a second to observe what you are thinking right now. Chances are, you are engaged in some form of thinking about the future (predicting) or the past (learning).

Worry, anxiety, fear, regret, bad memories – the mind at its worst is full of these! They are uncomfortable, distracting and aren’t always useful.

The Standard Meditation Algorithm gives us a practice that helps us to connect more with our Present Moment Experience.

If we’re faced with the problem of being consumed with the past and the future, it makes sense to practice this overlooked aspect of our experience – the what’s actually going on right now.

It’s important to emphasise that there is NO NEED to actively eliminate thoughts and thinking when practicing the Standard Meditation Algorithm. Instead of an active, task-based approach to solving the problem of excessive thinking, by making the decision to direct our attention elsewhere, we are starving the thoughts of fuel.

Most people find that thoughts will settle themselves, to some extent, without any action by themselves, by simply choosing to focus and refocus on the present moment during a meditation session.

Practicing Meditation

So, enough talk. Let’s get down to the business of meditating. In this section, we’ll introduce two meditation practices that apply the Standard Meditation Algorithm.

The type of meditation we introduce here uses a very fundamental capacity of the human mind – the capacity to pay attention. To meditate in this way is to selectively tune our attention to be aware of a particular thing, and to remember to redirect and refocus our attention as it naturally wanders.

I’ve created a few companion meditations for you to practice with. You can access them at this link – if you’ve already subscribed to my mailing list, it’s likely your confirmation email contained a link, so check your inbox.

Applying the Standard Meditation Algorithm

Let’s revisit the Standard Meditation Algorithm that we defined above. Pay particular attention to steps 2 and three as we’ll get into them in depth here.

Set aside some time in your day to intentionally practice meditation – typically 10-25 minutes is about right;

  • Deliberately relax the body;
  • Direct your attention at something – typically we use the breath, or the sensations coming from the body, but there are many other options – we’ll go into this in depth below;
  • Watch how the mind quite naturally resists staying focused (it’s crazy in there some days) – it WILL wander, this is 100% expected and you will notice it happening;
  • Restore your attention as the mind wanders – maybe ten times, maybe a hundred, maybe a thousand! The number really doesn’t matter – as long as you remember to redirect your attention back to your meditation from time to time you are meditating 100% correctly;
  • When you emerge from your session, check in with yourself and notice what’s emerged as a result.

We’ll discuss instruction 2 – relaxation – in the next section. We’ve already given attention to instructions 4 and 5 (what to do about thoughts and distraction) above.

Instructions 3 tells us to direct our attention at something. We need to consider what that something should be. Let’s call this something the “anchor” point for the meditation – the place where you’re going to rest your attention for the duration of the meditation itself.

The ideal anchor point should have the following characteristics:

  • It should be easy to bring into awareness;
  • It should always be a part of your present moment experience;

Here’s a list of things that, to my mind, meet the criteria. You can choose any one or even a combination of each to be the anchor point for a given meditation session.

  • The feeling of the breath;
  • The physical sensations in the body;
  • The senses – sight, sound, touch, hearing, smell;
  • The emotional tone – how you are feeling;
  • The state of the mind – what and how you are thinking

It’s easy to verify that each of these meet the criteria above. Simply take a moment, close your eyes and tune in – notice your breath, notice your body, savour what’s on offer from your senses, observe how you are feeling and check the state of your mind – you’ll very quickly be able to connect with each, if only for a moment.

The first and second of these are extremely common anchor points for attention. Pretty much every meditation tradition that has ever existed has included a variation of each of these. For that reason, we’ll concentrate on these for the rest of this guide, and leave the others for a later time.

Relaxing the body

A good meditation session starts by bringing some relaxation to the physical body. As we go about our day, our stress response is continuously activated, which can if left unchecked lead to a body that carries too much tension.

This often shows up as physical aches and pains (think tense shoulders). Chronic stress leads to muscle fatigue or high blood pressure.

Here are a couple of great ways to relax the body.

  • Taking several deeper than normal breaths – the video in the introduction section gives very clear instructions on how to do this (the link is here if you need it), or follow along below;
  • Deliberately relax any stuck spots.

Deep Breaths
One of the signs of a calm, relaxed nervous system is slow, deep breathing.

One of the quickest ways to create a calm nervous system is to practice slow, deep breathing. It’s a wonderful hack that I often use to reset myself when I notice my stress levels have spiked.

It’s pretty easy to do. Place a hand on your belly and another on your chest.

When stressed, our breath is often (1) shallow (2) fast.

Notice how your breath is right now – if it’s shallow, you’ll feel the hand on your chest moving noticeably.

  • To calm the breath, start to breathe so that you notice the hand on your belly moving more than the hand on your chest. Direct the breath into the belly (it might take a few goes to get the hang of it).
  • Start to slow the breath down, and even it out so the inhale is about the same length as the exhale. You can do this by mentally counting to four as you inhale, then again as you exhale. Maintain the breath in the belly as you do this.

About ten rounds of this type of breathing is often enough to noticeably relax the body. If you take one practice away from reading this guide, let this be it. Practice it a few times a day for a week and see the difference in your overall stress levels, and your focus!

Conscious Relaxation
The body doesn’t necessarily want or need to be tense. Tension and stress are meant to be short term states, from which the body and mind are meant to return.

The body has in-built mechanisms for returning to its equilibrium point. Many people find that simply taking moment to feel into the body to observe where the most obvious tension is located, and mentally inviting those points to relax, can be a great way to shed tension.

Sometimes it helps to direct a breath into that space while holding the attention there.

In cases of more significant stress or tension, it can help to deliberately tense and release each area of the body. For example, tightly shrugging the shoulders, or clenching and releasing the fists, can be a great way of relaxing tension.

Meditating with the breath

Breathing is the most automatic thing we do. It’s the most fundamental action of our body that keeps us alive. Yet we often give it little more than passing thought during our day-to-day lives. Developing an awareness of the breath is a wonderfully simple way to help build awareness; to learn to let go of an overactive mind.

The simplest observation you can make about the breath is that it is always happening.

While we live, we breathe. When we cease to breathe, we cease to live.

So please keep breathing!

This makes the breath an excellent anchor to the present moment. We’ve previously discussed how anchoring to the present moment is a natural antidote to the past/future orientation of the wandering mind. To recap:

  • Your mind loves to live in the past and the future, dwelling and predicting;
  • We can get very caught up in this type of thinking, which often contributes to stress and anxiety, as well as preventing us from enjoying the richness of the present moment;
  • When we practice focusing our attention on an anchor, we can begin to let go of the activity of our minds and regain a sense of what’s going on right now.

The breath has a number of distinct advantages as an anchor:

  • It is happening right now, which means it is entirely about the present moment
  • It is always there, meaning we can always return our attention to it;
  • It happens in the body, allowing us to begin to develop awareness of our body (see next section on meditating with the body

The beautiful thing about breathing meditation is that you can use it at any time, or anywhere. It is a simple practice that you can bring into your daily life, for use in any situation where you might feel stressed, anxious or out of control.

Breathing is an extremely physical activity, involving the expansion of your entire torso to receive the fresh air that nourishes us and keeps us alive. When you stop to consider your breath, the depth and variety it contains can surprise you.

Take a few deep breaths right now with the following in mind:

  • The air as it hits the back of your nostrils. Is it cooler on the way in? Warmer on the way out? What speed is it moving at?
  • The movement of air through the throat;
  • The expansion of the chest cavity in preparation to receive the air;
  • Movement in your belly associated with the expansion of your chest;
  • A moment of stillness at the end of each in-breath and each out-breath, where the body lies poised, ready to inhale or exhale.

You might also like to examine other qualities of the breath, such as speed, depth, tension/relaxation and so on. Do you feel the energy in your body change at the end of each breath?

I’m sure that when you slow things down, and start to savour the breath in this manner, you’ll find that there is a richness to your breathing that you may not have noticed before. Every breath is both vital and different.

How “should” my breathing be?
People often have a preconceived idea that their breath “should” be a certain way while meditating. Whenever you find yourself using the word “should” when thinking about meditation, it is a warning sign.

Meditation effectively is mostly about building awareness of the world as it is now, rather than struggling to shape it into some state that you think it “should” be.

In mindfulness meditation, the same principle applies to the breath – it “should” be however it is right now. Fast, slow, deep, shallow, tense, relaxed – whatever it is right now. Chances are, how your breath is right now is not how it will be in five minutes time!

The breath quite often slows and deepens as we become more practiced at meditation and you may notice that this happens even within one meditation session. But be curious about its variety and how it changes. Apply the same principle of curiosity to your breathing meditation as you did to your body meditation.

How naturally in touch with your breathing are you? Is it something you notice every day? Or do you forget about it easily?

Meditating with the body

There are two great reasons to develop body awareness practices.

  • Focusing on the body is a way to let go of the mind;
  • The body is full of information that we can use to improve the quality of our lives.

Living in our society makes it very easy to become wrapped up in the activities of your mind.

Many of us work in mentally demanding jobs.

Thinking, analysing, communicating – all of these activities force us to engage our rational brain. The demands of modern living make this true even if we are engaged in physical activity throughout our working day, or have a regular exercise practice.

As I’ve repeatedly stressed, the mind in general is a very effective machine that allows us to do all sorts of useful things. But it is our bodies that allow us to actually interact with the world around us, so it’s really important not to lose touch with them.

Getting to know the body
Our bodies are the realms of senses and emotions.

Our senses allow us to gather information about the world around us. We use sight, sound, touch, taste and smell – separately and in combination – to develop a moment by moment picture of the world we are inhabiting.

The senses are firmly embedded in the body. Our sensory receptors are physical – think cones in the retina, receptors in the nostrils and on the tongue, all kinds of receptors in the skin….

Our feelings, or emotions, are often associated with our initial reaction to new information gathered through the senses. Many people think of feelings as mental constructs, and indeed, emotions often have a flood of thoughts associated with them.

But most emotional responses can be felt in the body. They often mean that the body is preparing you to take some action in response to the new information.

Let’s take the example of fear, which is the primary emotion associated with stress and anxiety in particular.

Imagine you are walking through a forest. Suddenly you see (with your sense of sight) a bear on the path up ahead. Unless you are very comfortable around bears (well done if you are!), you’ll probably notice a number of physical sensations – possibly including increased heart and breathing rates, tense muscles, sweating, goose-bumps and so on.

The physical response that you experience provides you with information about your surroundings, and suggests to you that action must be taken in response (e.g. run away from the bear!).

Our emotional responses contain some very useful information at times (I’m sure you’ll agree that fear of bears is pretty sensible!). There are a number of problems with how they operate in our modern world though, for a couple of reasons:

  • Because we are so heavily wrapped up in the activities of our mind, we are often unaware that we are in the middle of a heavy emotional reaction (stress, worry, frustration), which means we can’t moderate our actions appropriately. Emotions sometimes run the show when we’d prefer them not to;
  • Many of our emotional responses ask us to take physical action, such as running, which are not always possible in a modern environment such as an office. The emotions get “stored up” in our body. If we’re not aware of this happening to us, we can’t take action to counteract it.

The good news is that becoming more aware of our body is the first step towards becoming more in tune with our emotions and learning how to work with them more effectively.

The Body Scan
The Body Scan is designed to help you get in touch with your body. In this meditation, you’ll be invited to bring your awareness to each part of your body in turn, with an attitude of curiosity. So, what exactly does this mean, and how should you respond to this invitation?

What does it mean to “bring your awareness” to a body part?

Take a second out of your day and pinch the back of your hand. You’ll find that your awareness is drawn there quite quickly!

To “bring your awareness” is to deliberately feel for the sensation in a body part without having to pinch it or otherwise manipulate it.

In a body scan meditation, we practice bringing the awareness to the points of contact of your body with the surfaces that support it. If you check in now, I’m sure you can bring your awareness to the parts of your body that are on the chair or floor beneath you. The sensation may not be particularly strong, but if you concentrate I’m sure you will soon notice it.

In general it’s easier to feel stronger physical sensations. It may be the case that you feel quite neutral in parts of your body. Or you may feel pleasure, or relaxation. Anything you feel is OK!

Approach the body scan exercise with an attitude of curiosity. This simply means observing rather than trying to change things.

You will often find that just observing something physically eventually leads to some relief. For example, just becoming aware of the tension in your shoulders is often enough to get them to soften, even just a little.

What about uncomfortable feelings? Shouldn’t we try to get rid of them?

Well, much as we may wish it were otherwise, uncomfortable situations are a part of being alive. Learning how to sit with something unpleasant, or even neutral or “boring”, in meditation is good practice for remaining centred during those parts of day-to-day life that are less than perfect. With practice, you will learn how to maintain a sense of balance in the face of difficult situations.

Learning how to listen to your body accurately is a great way of gaining information about whether or not you need to respond to something in your environment. Many of us have a tendency to suppress uncomfortable feelings. This is quite understandable – bad feelings don’t feel good! But suppressing feelings can mean losing information about what’s going on. If you’re uncomfortable, it may mean that you need to take action to change something in your life.

The body is a wonderful organism. As well as protective mechanisms such as the stress response, the body has a quality called homeostasis – a physiological tendency towards an equilibrium point.

To say that the body is relaxed is to say that the optimum amount of tension exists in the body for the task at hand – any more and we say the body is stressed.

Meditating with the body gives the homeostatic mechanisms something to work with. Simply bringing awareness to a tense body part can trigger the automatic relaxation responses that ease tension.

Learning to meditate

We’re close to the end and I hope you know a bit more about meditation and its benefits than when you started reading. Thanks for reading so far!

I wanted to share some hot tips for learning how to meditate that I’ve picked up over the years of teaching hundreds of people. Following this advice will help you get to grips with your meditation practice!

The components of meditation practice
I tell every student I have that learning to meditate has three parts. They are:

  • Wisdom
  • Practice
  • Reflection

Wisdom refers to the body of knowledge surrounding meditation. It includes meditation techniques, supporting information (such as information about stress and the nervous system) and common pitfalls and issues that nearly everyone encounters on the meditation path. Wisdom is fascinating in its own right, but you won’t get anywhere without… practice.

Practice refers to the meditation practice itself – it should be obvious why this is important! It’s where you really get to grips with studying yourself, and it’s the place from where all the benefits arise. You’ll get plenty from practicing by itself, but it’s supported by wisdom, and it’s greatly enhanced by… reflection.

Reflection means considering the effect practicing meditation has on you. It means sharing experiences of meditation (with yourself, through journaling, or in a group, through conversation). Reflection is a crucial part of learning to meditate well. I spent years meditating by myself with recordings and apps, but when I found teachers and other humans to share my experiences within and around meditation that things really took off.

Little and often beats big chunks
I encounter a lot of people who might take a meditation class every week, but don’t practice at all in between.

Doing five minutes of mindful breathing five times a week is a better way to get your meditation practice going than doing one big session. Regularly entering the space of meditation means you get a sense of what it has to offer more frequently. And it helps to make meditation habitual.

Stack your habits
The best way to build a habit is to stack it on top of something you already do regularly. The existing habit becomes a trigger to do the new one.

I have several triggers that tell me to meditate. After my morning stretch – it’s my main meditation session of the day. And immediately after any physcial activity (yoga and strength training). I hang my meditation practice off these fixed points in my day – points that always arrive.

You might need to experiment, but if you’re already engaged in a virtuous habit (perhaps not after a cigarette break!) you might consider a few moments to meditate.

Further reading and resources

You can read plenty more on this very website..

Here are three amazing books about meditation that I highly recommend:

  • Waking Up, by Sam Harris. A secular guide to the depths of meditation practice.
  • The Foundations of Mindfulness, by Eric Harrison – a wonderful, in-depth guide to meditation for any audience
  • Meditation – An in-depth guide – by Paul Bedson and Ian Galwer.


All of my teachers and students past and present went into the making of this guide.

I’ve been enriched by many converstions with members of the programming community, most recently on Instagram – too many to name here but in particular thanks to Nate, Joe, Lydia and John for proofreading and providing incredible feedback.

You can get a PDF copy of this guide by simply filling in this form – I’ll send it direct to your mailbox! I’ll send you follow-up emails to check in later on, as well as other awesome content about mindfulness as programming.