Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm practicing mindfulness since a few weeks, a popular form of secular meditation which concept is to focus yourself on the present moment. It works so great I don't understand why not more people are rushing into that practice.

It's useful for me because I've important responsibilities in several companies, and I have to manage a high level of pressure. Programming is still a large part of my daily occupation, but most of what I do and will do in the future is working with programmers, not programming itself.

That's what I'm questioning. As a programmer we use the past and plan for the future all the time very actively. Being in peace will certainly help with interpersonal interactions and communication, but the so specific intellectual task programming is?

Is meditation decrease our ability to do that, in profit of more peaceful and happy life?

Is meditation a good or bad thing for our programming abilities?

I will be very interested in the way to do meditation too. For example, I use breathing.

UPDATE APRIL 8 2011: just finished the 8 weeks Jon Kabat Zinn training (MBSR). While it's too early to measure benefits on my programming abilities, I can tell you it reduced overall anxiety significantly. I strongly recommend the program.

share|improve this question

closed as not constructive by Mark Trapp Dec 11 '11 at 17:56

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

I'm not sure how meditation uniquely affects programmers and developers. Surely any benefits apply to people in all walks of life. Please read the updated FAQ –  ChrisF Jan 22 '11 at 11:18
@ChrisF: I'm specifically interested by experiences of programmers, other professions are irrelevant for my researchs. It's why it's uniquely affects programmers. I read the faq again and compared with questions of the past 24h to determine their uniqueness and many of them are concerned. I see your comment only on this one, why? –  user2567 Jan 22 '11 at 11:42
It was the first one I saw this morning that I felt was borderline. I haven't had time to review every single post (nor shall I have the time), if there are others please bring them to the moderator's attention. –  ChrisF Jan 22 '11 at 11:45
@ChrisF: you can go back in time for the last 7 days it's the same. The problem must be elsewhere. –  user2567 Jan 22 '11 at 11:50
In addition(not substitution) You can try CBT ("Feeling Good" is a good book.) –  zhenka Jan 22 '11 at 23:06

6 Answers 6

up vote 58 down vote accepted


I've done mindfulness practices for several years since doing some DBT classes. They're not going to make you an instant algorithm whiz, jack up your lines-of-code-per-day by an order of magnitude, or let you code 24 hours a day non-stop.

But here are some things I've seen...

You become more effective at dealing with what's really going on

Would you try to install kitchen cabinets that are level and square and fit well together while wearing a blindfold and thick gloves? Would you drive on a crowded freeway while watching a TV set on your dashboard in front of the steering wheel?

We spend much of our lives distracted by thoughts of other times and places. But when we need to deal with things that are immediate, that's like a blindfold and gloves, or watching TV instead of the road. At times, it can be like trying to code while a dozen people are screaming at you.

Mindfulness helps us get rid of those cognitive distractions. So when someone comes to you with a programming task, you can actually pay attention and hear what they're saying, rather than the distractions in your head.

You develop mental self-discipline that helps you write necessary-but-boring code

Especially when bored, the human mind likes to jump around among thoughts like a puppy - sniffing at this, barking at that, rolling on the floor, and licking people it likes. That's fine if you're taking a nice peaceful walk outdoors, but is a terrible way to write code that is boring but just has to be done.

Mindfulness practice is like self-discipline weight-lifting for the mind. During a meditation session, you try to accept your mental puppy-ness and not punish yourself for it, but keep bringing your mental focus back to the meditation. Over time, your ability to concentrate increases, and so does your ability to crank out boring-but-necessary code.

You're much calmer when coding, and thus more productive

Our brains developed on the African savannah, where no matter what a hominid was doing, 10% of their minds needed to be watching out for cheetahs and lions to avoid being eaten. So when we think about other times and places, our minds often gravitate toward things that annoy or upset us: the deadline we might not be able to meet, the person we work with who's a jerk, the bad news that was on TV about something far away, or the disagreement with our significant other that morning. Those all tick over in the back of our minds while we're trying to program.

Mindfulness teaches you to try to be in the moment - and the truth is: Most of the moments of our lives are pretty damn good! Especially in first-world countries, 90+% of the time, we're warm, clothed, adequately fed, in a comfortable environment, and nobody's screaming at us and nothing's trying kill us.

So mindfulness practices help you take that 10% of your mind that's fretting about all that other stuff, and cranking out stress hormones and muscle tension, and quiet it down. You ignore the war in Whereveristan for the moment - which is good because you can't do a thing about it while you're at work - and look around and think, "I have a hot cup of coffee, a comfortable chair, the temperature's nice, and I have some code to work on. This is really pretty great!"

You take better care of yourself

A friend of mine who does a lot of physical work wanted to know about mindfulness, so we did what's called a "body scan", where you concentrate on feeling each individual part of your body, a few seconds at a time.

I first asked how he was feeling, and he said, "Fine." So we started, and in about twenty seconds, he was yelling, "OW! OW! My legs! My knees! Man, this really sucks! It makes me hurt all over! Why the hell does anybody do this?"

Of course, it wasn't the body scan that made him hurt. He was already hurting all over - he just had been ignoring it for so long he didn't notice it. After he'd done mindfulness practices a little while, he learned to be more careful about what he did, he figured out better ways to do his work that didn't hurt him so much, and it was amazing how much better he felt about life in general.

It can be the same thing with non-physical things. Let's say your boss is a jerk but it's gone on so long you ignore it. Then you become mindful, and say, "Hey, wait, my boss is a jerk." So then you deal with it somehow (talk to him, change jobs, etc.) and then you're happier. Or at least you make a conscious decision to not deal with it, so you don't stress about it subconsciously.

You enjoy life more

Let's say you're eating some delicious cake. The two ends of the mindfulness spectrum are:

  1. Wow, what a great piece of cake! This tastes so good. I'm really enjoying this!
  2. I wonder what's on TV tonight. Probably nothing good - maybe I should rent a movie. If I rented a movie, what would I rent? Hmmm. I think I'd like a comedy. Hey, where'd my piece of cake go? I wonder if it was any good.

You learn more about yourself: what you are and aren't good at, what you do and don't like

Some folks describe mindfulness meditation as "going for a swim in the sea of me." I've discovered two things about myself and programming, in part because mindfulness practices have led me to pay more attention:

  • I love writing graphics code in C and C++. I'm really good at it, it exercises a lot of my talents like mathematics, and I enjoy writing the code and watching the result on the screen.
  • I hate developing web sites. While I love the result, and respect people who are good at it, it just ain't me.

Guess which one I'm concentrating my programming career on?

share|improve this answer
Simply amazing answer! I'm speechless. –  user2567 Jan 22 '11 at 22:08
This deserves the "best answer" –  zhenka Jan 23 '11 at 0:05
+1 This answer made me want to try meditation. I'd consider myself a decent programmer, but I can only focus when I'm focused basically. I'm constantly thinking at all times. This is a good thing in a way because when I'm doing something repetitive(not programming) I don't get bored, instead I think about other things and resolve problems. It's a bad thing because I tend to resolve non-programming problems when I'm trying to program. –  Earlz Feb 12 '11 at 5:54
@Earlz: If you find you like it, you might also try some non-meditation mindfulness practices. You can find instructions online about doing all kinds of things mindfully, like eating a Hershey's kiss, drinking a cup of coffee, or washing dishes. And if you find you like that, check out "The Miracle of Mindfulness" by Thich Nhat Hanh; it's a great primer for becoming more mindful in daily life. –  Bob Murphy Feb 12 '11 at 7:01

I am Yoga guy from the last 5 Years. I find that it is very useful in being in the present moment. What I like more about it is it increases productivity and problem solving skills, you get more done in lesser time. It also helps me be at peace with myself. I don't think it hurts programming abilities in any way, what it does take away is procastination and worry these are not necessary to write good code.

Yes it takes a little bit of aggression away and aggression(positive) is sometimes good.

share|improve this answer
Mindfulness practices don't have to take away aggression. I'm at least as aggressive than I was before I started doing them - I'm just much better at directing it well. –  Bob Murphy Jan 22 '11 at 22:05

Well, in my own experience, not only has meditation helped me manage my thoughts and coordinate my efforts in programming, but programming is itself a deep form of meditation for me. The act of programming is, at its best, simply letting the program write itself in the way it ought to be written; the code is like the water of a river, the programmer the riverbed, simultaneously shaping and being shaped by the flow of information and reason. When the two are in harmony, the river takes on its natural shape and flows effortlessly; when the riverbed seeks to control the river, it can only fail, and the river will probably overflow and be really damn annoying to fix.

If meditation helps you relieve stress so you can work, then by all means do it, but for me, programming (and creation in general) is the meditation that relieves my stress so I can live. To try to be more mindful of the present does not mean disregarding the past or future. In fact, there is no such thing as the present, so to be truly mindful of it is to transcend the need to remember or plan, and simply do what must be done in the way that is most natural and correct.

share|improve this answer
Jon: you did not mention what type of meditation you do, would you agree to share that with us? –  user2567 Jan 22 '11 at 10:57
@Pierre 303: I don't know if there's a name for it. It's something I arrived at on my own through experimentation. I sit relaxed and upright, clear my thoughts, and lower my breathing and heart rate. I tune out all my senses, and let myself be as aware as possible of just myself, without thinking of anything specific. If I want to impress an idea upon myself, I repeat it as an internal mantra. In that respect it's similar to Transcendental meditation, but my practice is purely secular. –  Jon Purdy Jan 22 '11 at 11:07
@Jon: You serious ?? How do you lower down your heart rate ?? –  Geek Jan 22 '11 at 14:40
@Geek, try to breathe very slowly, you'll notice that your heart slows down (a little) when you exhale –  Thomas Levesque Jan 22 '11 at 22:17
@Geek - Exercise (lowers resting HR but takes awhile to see effects), avoid caffiene & alcohol, lose weight, relax, meditate, there are several drugs and cardiac illnesses that will work as well but not recommended. –  JeffO Jan 22 '11 at 23:56

Absolutely. But take it from an ex-Neuroscientist who used to be as obsessed about psychology as I am now about programming: the western version of mindfulness, while does a good job secularizing and introducing the practice, does not go into as much depth as the sources of this practice -- the eastern philosophies.

I am not advocating Buddhism or Hinduism or Yoga, nor I consider myself one. However to truly understand and get the most benefits from Meditation and Mindfulness, you need to understand a lot of surrounding philosophy which is very important. It will take time, and most of the time you will get it wrong, this is normal. If you feel that something is not right about your ideas, results, or the practice, a lot of time it is because there is something you are doing wrong and you need to go back to theory. Just to clarify what I mean by philosophy has nothing to do with religious rituals, but more about surrounding thought like "The Eight Fold Path."

Some of the best sources to do so IMO is this website: http://www.audiodharma.org/teacher/1/

It is the most modernized version of Buddhism without any superstition on Monasticism. Gil Fronsdal is as good as it gets. He also has a free book available called "Issue at Hand."

If you want additional sources try Stephen Batchelor.

share|improve this answer
Interesting stuff. Who is that ex-neuroscientist? –  user2567 Jan 22 '11 at 22:55
If you do explore the source of these idea, please be aware that there are A LOT of branches and sub-branches based on teachers and countries. Some are much more nonsense then others. Do not try to read wikipedia or googling it as you will get very bad new-age information that will turn you of. –  zhenka Jan 22 '11 at 22:58
Ex-neuroscintist is me. But if I am not good enough : ) Sam Harris is a famous author/neuroscintist who is an active proponent. But he is most famouse for his ethic/atheist writings. –  zhenka Jan 22 '11 at 23:00
youtube.com/watch?v=FHBkyrcDE5U this is a good example of what I mean. 8m segment of Sam Harris talk. –  zhenka Jan 22 '11 at 23:02
Which books do you recommend? –  user2567 Jan 22 '11 at 23:05


I'm a proud Muslim and I'm most satisfied when I'am praying. This may be equivalent to your "meditation".

share|improve this answer
I saw a recent study that shows that people practicing religion are more happy than the rest of the population but more importantly live 7 years older than them! –  user2567 Apr 8 '11 at 9:19

Definitly Yes

Well i think that any activity that allows you focus on what matters is always good. I personally prefer a more active way to focus, so i've been practicing Aikido for a year now and i can tell you that breathing techniques are quite appropiate when you need to focus on a aggresive environment (with aggresive i mean to concentration, like very noisi and crowded).

So keep up with your excercises, they not only help you with your work, it helps you enjoy more your life

share|improve this answer
do you mean "breeding techniques?" Yeah, those always help to chill me out. –  Yar Jan 22 '11 at 23:12