Subscribe to the Hired Download: our newsletter for top talent like you!


How Mindfulness Can Make You a Better Programmer

Maybe it was the last time you listened to a podcast, skimmed recent headlines, or caught up with friends, but chances are, it hasn’t been long since you heard a reference to “mindfulness.”

No matter what your personal experience with it, you’ll probably agree that mindfulness is having a moment in American life. There are books on mindfulness for athletes, mindfulness for weight loss, mindfulness for kids, and, of course, Mindfulness for Dummies.

But what may seem like a recent cultural phenomenon is much more than a passing trend: since 1979, when MIT-trained molecular biologist Jon Kabat-Zinn decided to integrate ancient Eastern practices into modern Western medicine, increasing data, countless studies, and thousands of peer-reviewed articles have confirmed the physiological and psychological benefits from practicing mindfulness meditation.

We’re not talking about your fringe hippie uncle’s mystic chanting and gong-ringing. While Kabat-Zinn’s original focus was using mindfulness to treat chronic health issues, iterations of his original Mindfulness-Based-Stress-Reduction (MBSR) have been used successfully in medicine, mental health, and social institutions like schools, prisons, and the military.

What is mindfulness?

Despite–or maybe because of–its ubiquity, there’s plenty of confusion and/or misunderstanding over mindfulness. Certainly, being aware of our thoughts has been around as long as humans have realized we have thoughts to be aware of. So it’s important to note that your understanding of mindfulness may be different than your neighbor’s.

For the purpose of this article, “mindfulness” is the intentional practice of bringing your awareness to the present moment.

It sounds simple, right? So simple that you may think to yourself, I don’t need that. But have you attempted to sit still and watch your own thoughts lately? And have you done that without getting totally swept up in them within seconds? Being aware of the present moment isn’t as easy as it sounds.

What mindfulness isn’t

Before we jump to the benefits mindfulness offers engineers, developers, and programmers, it may be helpful to note a few things that mindfulness isn’t:

  • Mindfulness is not a religion. While it can be incorporated into a religious or spiritual practice, the model popularized by Kabat-Zinn is strictly secular.
  • Mindfulness is not eliminating difficult thoughts and feelings. Mindfulness is noticing difficult thoughts or feelings (anger, frustration, envy, resentment, annoyance) and letting them pass without lingering on them, indulging them, or judging their usefulness.
  • Mindfulness is not controlling your thoughts. While some meditation practices emphasize focus and/or repetition, this practice utilizes the one thing we all have that is constant yet ever-changing: our breath. Making a mental return to notice your inhalations and exhalations whenever your thoughts start to wander is all it takes to realize we can never completely control our thoughts.
  • Mindfulness is not trying to change who you are. The purpose of mindfulness is not to become jedis, saviors, wizards, sages, or saints. Mindfulness is being you. With awareness.
  • Mindfulness is not a waste of time. A point of emphasis in the practice is that it’s non-judgmental. The bad sessions aren’t actually bad. The good sessions aren’t actually good. The sessions just are. Try not to get hung up on expectation or frustration.

How mindfulness will help you write better code

Great coding requires a few things from a developer outside of technical ability: mental stability and focus, patience, and open-mindedness. Practicing mindfulness offers the following:

  • Increased Productivity Overwhelm happens, especially in the early and late stages of a project. Programming is done one line of code at a time, which can be difficult to accomplish when expectations for the bigger picture loom in your mind. Practicing mindfulness will reinforce a mindset that is able to engage in the task at hand.
  • Increased Focus Do you struggle leaving life-distractions behind during work or work-distractions behind during life? When you can’t focus on what’s in front of you, you’re struggling to control that which is out of your control. This is typical for many of us, but just being aware of the patterns will help you get to the bottom of when, where, how, or by whom you are distracted.    
  • Enhanced Flow Getting into a state of flow while coding is a beautiful experience: you are fully absorbed in the present challenge with an energized focus, losing track of space and time, feeling pure satisfaction when you finally come up for air. That state of flow depends on factors that you can develop through a mindfulness practice: having a longer attention span, being receptive to immediate feedback, and feeling stimulated by a challenge.
  • Increase Stability Practicing mindfulness means watching your thoughts like an objective spectator of a tennis match, with no attachment to, or expectations for, the outcome. The more you practice this, the less reactive you are to thoughts, experiences, and actions that come your way. You will improve your quality of code by being less reactive, stressed, or rushed as you allow yourself to marinate on a request or challenge.

How to start practicing mindfulness

Remember, this is a practice! Just like any new practice, you’ll need to build endurance before you can tackle the biggest hurdles. Starting small–with 2-minute sessions–will increase the likelihood that you’ll stick with it over time.

Before work

  • Before you head into your task, find a quiet, neutral space where you can sit for a few moments, either on the floor (this helps create a sense of being grounded) or in a chair.
  • Set a timer for 2-3 minutes, relax your jaw so that your lips barely touch, and inhale fully, feeling your lungs and belly expand with oxygen. No need to force anything: now just exhale.
  • Repeat this process until the timer goes off.

Chances are good your mind will want to wander while you’re breathing. That’s okay! Let it wander, making an attempt to notice the thoughts that pop in, let them go, and gently redirect your mind to those inhales and exhales.

During work

Maybe you’ve heard: sitting is the new smoking. Americans are sedentary for an average of 9-10 hours a day, with major health risks related to those who sit with frequent uninterrupted bouts of 30 minutes or more. Take note of when you’re having trouble getting into a state of flow with work or, perhaps, when you’re coming out of a state of flow. These are great opportunities for some mindful movement. If you’ve got the space, unroll a yoga mat and for some quiet stretching, take a walk through the hall, or just stand in place and move your arms. While you move, begin the breathing and thought-watching practice described above. Start with 2-minute breaks and soon you’ll find that you want to add some time!

After work

Maybe it was a productive day, maybe it wasn’t. Either way, it’s time to let go and leave the work for your future self. Your present self is moving on with the rest of your day. It’s time to sit or move again in a mindful way: set your timer (this timer is a key part of the ritual!), begin with a thoughtful inhalation, and simply breathe and watch.  What will you notice? A regular habit of closing your work this way will allow you to let it go, ready for you to pick up with intention next time, but only when it’s time.

Do you have a mindfulness practice? How has it affected your work? Leave some thoughts or tips in the comments below!