Stack OverflowHow do you maintain your mental health in your programming job?
[+38] [29] tkotitan
[2009-01-22 21:23:39]
[ career-development ]

I burned out a few years back, really bad. Like my nervous system partially shut down for a while because I pushed myself too hard. Thankfully I had good benefits and came back (after I stubbornly took my time and over a year off). Working as a programmer didn't help, it turned out my source of the problem wasn't work, work just exacerbated the problem. I'm doing fine writing code again, trying to keep my health in check. I'm trying not to make this a life story.

In my journey I learned that that there are different kinds of health. I figured out three on my own, but was serendipitously visited by an "expert" one day who gave me what I call The Bar Napkin of Health. A pie chart with six kinds of health: Mental, Emotional, Physical, Social, Occupational/Volitional and Spiritual.

I was in a state where my mental health bottomed out to zero. The difficulty is these things are all interconnected so it gets complicated. My physical and emotional health wasn't too far from zero either, so it's better than having a heart attack or becoming a psycho. I ended up helping a lot by improving my physical health first (was overweight, addicted to soda). Also improving my social health (becoming a barfly in a small town, making new friends) helped me out emotionally very well. I learned a lot. And I had good friends before I burned out, but social health needs updating sometimes.

My point is, is when one kind of your health approaches or hits zero, it drags the others down, and it accelerates. The worse it gets, the worse it gets.

I would classify myself as a typical good talented programmer, who given enough time can make any piece of code work, wether I wrote it or not.

So my question is to fellow employed programmers, how do you keep your mental health in check when you are stressed or overwhelmed? Weekly visits to the bar? Crawl into your cave of solitude for music and games? Exercise/competition? Faith in your work or outside of work? Or is coding so easy you never stress about it? Zoloft?

Another good question is what are your warning signs you look out for? Talking about work too much at lunch? Oversleeping and still feeling tired? Suicidal thoughts? Blood pressure so high you can bake with your forehead?

Another related question, is have you found therapy to work? I need to complain about my problems to people who understand them, which is usually my co-workers, so I don't think it would be effective for me.

If it's a pie chart... Made of 6 quantities between 0 and 100, and 5 of the elements reach 0, shouldn't the 6th element reach 600? - shoosh
+1 ty from someone near bottom - ccook
(1) Enough with the repeat question nazi's! :) live a little please, it doesn't hurt to hear someone else's point of view on a issue - Andrew Harry
I second the nazi comment. You guys are slowly killing new discussions and it will start to hurt Stack Overflow overall. - wrburgess
+ 1 : Very nice question ! - Matthieu
@tkotitan 's story sounds just like the Sims game :D - Victor T.
[+20] [2009-01-22 21:26:52] Kevin

Doing Exercise.

As far as noticing when you are having problems. When you start feeling run down (almost all the time, we all have periods of stress), generally there is a problem with your lifestyle that you need to correct.

[+18] [2009-01-22 21:29:14] Alex Fort

Blasting some terrorists/monsters/zombies in the face with a high powered gun usually helps. Video games are surprisingly therapeutic.

Working on a personal programming project is quite helpful for me too, because it brings the fun back into my job. Running and a nice long weekend are good too :)

(2) I do that too. Oh wait, "videogames"? Never mind. - Paul Tomblin
There's a large platoon of zombies on my way home from work too. It's not just you. - Alex Fort
This works for me too. I'm not joking. It is an outlet. - dacracot
[+11] [2009-01-22 21:33:01] Fostah

My wife seems to be pretty good at managing my mental health. She once saw I was about to bottom out on a project and bought me a purple elephant named Lumpy. It was so out of no where that is was hysterical and some how kept me going. But, basically just taking a walk with her and venting about my day during that walk always seems to help.

Also, people in your life will certainly notice that you are getting run down before you do.

(2) Mostly youll hear "Dont work yourself to death". Say that to a person who literally are working himself to death and cannot find a way out of the hell, and he will hate himself more. Thats just add to the burdon. Its like tell a suicide jumper, "dont kill yourself on the way down!" - Stefan
I didnt mean to ruin the good mode of Fostah:s story. ;) Just wanted to add that sometimes the "help" or "good advice" isnt recieved as it was intended when a person is allready deep in it. - Stefan
[+9] [2009-01-22 22:44:57] community_owned

I jogged daily and still mananged to burn out just as tkotitan did. It took me about a year to recover and I feel fine now. These days I still exercise, but I have a few new tricks to stop that from happening again.

  1. I sometimes don't even take my laptop home
  2. Progressive relaxation
  3. Meditation, yoga. Its new age hype, but probaly the most effective
  4. Tapping (
  5. Jog, lift
  6. Ive also gotten back into playing music and recording

The point is to do something for your body or that is mentally relaxing, since your day job is so mentally demanding, and if your sensitive enough to the burnout feeling, you'll know when to stop and look for something else to do - whatever ends up working for you.

Enjoyed the tapping site. Thanks for that :) - tardomatic
+1 for the music.... progressive relaxation and yoga are definately good as well. Check out Energized Meditation by Christopher Hyatt, tis crazzzy! - theringostarrs
I never take my laptop home :) the development work should only be limited to office premises. - Zain Shaikh
[+5] [2009-01-22 21:27:33] IainMH

The only thing that seemed to work for me in the past is running.

Take 30-40 minutes every other day, and run like Forrest.

[+5] [2009-01-22 21:35:43] rlb.usa

Moderation, healthy living, and taking breaks.

Related SO threads :


[+5] [2009-01-22 21:59:32] community_owned

I just type:

"All work and no play makes Jack a dull boy."

Over and over again.

[+3] [2010-09-17 08:05:23] mwangi

I only understood the stress factor a few weeks ago. Previously, I thought "stress is for the weak". I was dead wrong.

After a relatively tasking but exciting project that I was doing at my new workplace, I started feeling sick. I started feeling like I have Malaria (its a common ailment in Africa). I had felt those signs before and every time I feel that way, I (at times go for a test and) go to the chemist and get some over the counter pills for Malaria, that gets me back to my normal condition. Maybe in the previous times it was actually Malaria I don't know for sure.

This time I decided to follow procedure and go for a Malaria test. I went to the lab and tested negative for Malaria. "Maybe your tests are wrong... I know how I am feeling and it must be Malaria. I have felt this way before!" I argued with the lab technician before I decided to let go and see the doctor. The doctor looked at the test results and asked me "And you say you are feeling like you don't want to work, is that right? Are you losing your temper easily? Are you finding it hard to sleep at night? Is your work demanding?" The answer was "yes" to those questions. The doctor told me that those were signs of stress. I was advised to relax and he gave me some pills to help in relaxing.

That puzzled me and I thought to myself "I can't be suffering from stress!! What is stress anyway?" So, I went and googled some facts about stress. I was so surprised to learn about stress and burn out. I never thought that stress/burnout can have a very big impact in ones life. Stress makes chemical changes to the brain. It releases what is known as "stress hormones" in layman's language. And these hormones stay in the brain long before the stressful situation is over. Not getting rid of these "stress hormones" in your brain is not healthy. Exercise does this well.

So, I am now learning to avoid and manage stressful situations and that is not easy. But I have found out from googling that stress "creeps" into you, and that is the most dangerous thing about stress. It does not come at once like "bang!! Guess who is home...".

So I am doing things in moderation. Not doing code for the whole 8hours in the office (which had previously been the case). Exercise too helps, I have vowed to start exercising - going for a swim, and going back to playing the guitar - that has always worked for me previously when I had too much to think about and playing the guitar takes you to the 15th planet :)

[+3] [2009-01-22 21:34:06] annakata

Big warning sign: you don't want to go into work in the morning, and Sunday evening is a real downer.

Wish I knew how to fix it...

I think this happens to alot of people even if they like their job. - Jobo
[+2] [2009-01-22 21:51:04] moffdub

Right now, the thing that drives me nuts is all of the terrible code some of my co-workers, most of which "outrank" me, write. I deal with this by having very small side projects at home [1], that I never finish, to "cleanse" my palate. Also, writing in a blog [2] helps clarify my thoughts on why I think things aren't being done the right way.


[+1] [2009-01-22 21:42:20] DavGarcia

I started playing the guitar. Playing instruments takes so much attention that it is easy to get lost in it. Plus I feel much more constructive than just watching TV or playing video games.

[+1] [2009-01-22 21:35:51] Gambrinus

For me it is also playing video games and running or lifting weights. But the best thing is to do this with someone else like my girlfriend or a good mate. And afterwards went out for a beer or two and moan about all the problems you face during work and how the all drag you down - especially the nearer the weekend comes. Biggest problem for me are dawning deadlines and since there are always deadlines dawning (and failing) it is not a really healthy profession.

[+1] [2009-01-22 21:36:10] Robert S.

I am fortunate to have a significant other who exhibits patience and understanding when I'm going through something rough. "Marital relations" help a lot too.

(6) Dear Sir. I am interested in this "marital relations" and would like to subscribe to your newsletter. - IainMH
[+1] [2009-01-23 01:26:56] Twisted Mentat

Quick answers first: (Well that's how they were going to start off anyway)

How do I maintain my mental health?

Zone out playing games (pretty much completely computer), reading a book, going for a 3 hour walk, etc.

My warning signs?

I'd lump most everything into simply feeling stressed. Also starting to lose track of day to day things is another very important sign.

Does therapy help?

I've had therapy for for depression and I do feel it helped. If you're thinking about it I would strongly suggest you seek out a professional therapist. It's unlikely your coworkers and friends will understand and be in a position to help with these sorts of issues and are likely to feel overwhelmed. A professional therapist should be able to help you find ways of coping and more importantly preventing the worst problems from happening by helping you find ways to find your triggers and how to take care of them.

Now for the more personal stuff.

I had to learn how to take care of my mental health before I even started university due to suffering from severe clinical depression when I was 17 (I'm 22 now and still dealing with it at a lower level). I even had to repeat my final year of high school due to the effects of it. This forced me to recognize my triggers and build coping mechanisms that have served my well since. The main tenant I try to live by for my mental health really boils down to is:


When I start to feel stressed, overwhelmed, panicky, etc. I just drop eveything ASAP and start employing my coping mechanisms to regain control.

[+1] [2009-01-23 01:53:42] Robert Gould

Now on a dead serious note, eating beef(cow) is medically proven to relieve stress and induce happiness at a biochemical level. Not sure why but it has to be beef; pork and chicken don't have the same chemistry unfortunately. So barbecues are an essential part of recovering from the slump, seriously.

(1) It would be nice if you could post a link or reference for this statement (although I can believe it to be true)... - ChristopheD
[+1] [2009-07-22 10:50:35] community_owned

im a programmer too.12 years now.

best thing i found is since i started filling my evening with Physical/Social excercise. I started going swimming twice a week.. for just and hour and gym twice a week too for just one hour..

this gets rid of all stress... plus i meet new people every day (social) plus got me more fit and made me more in touch with my physical side...

i know this sounds wierd... and like the holy grail.. but its jsut that i struck exaclty the right balance between mental and physical well being.. and it affects all my life now... im fitter... stronger... never tired , and more attractive.. plus mentally clear all the time.

plus its makign me look younger!! smiles all aound!
i know many ppl would say " i have no time" but i did not have time too! untill i had a bad motorbike accident... then i realised i had time.

good luck all.

[0] [2009-07-22 11:02:39] Matthieu

Two tips to manage the stress :

  1. Doing some sports to "clear" your brain
  2. Getting enough sleep : This is very important to avoid burn-out, maybe the most important condition !

To summarize, I would say : mens sana in corpore sano ;-)

[0] [2009-07-22 11:46:37] TomFromThePool

More like nightly visits to the bar.

To deal with stress, I crank up my guitar and scream like a banshee for a good hour.

[0] [2009-01-23 01:37:42] jcollum

I've been reading about brain chemistry lately, so here's my chemical-oriented approach. Endorphins are good for you!

At the risk of getting tagged offensive: Sex. Oxytocin, promotes feelings of connection, empathy etc.

Spending time with your kids or loved ones. Also oxytocin.

Exercise helps a lot. Endorphins. And anti-depressant effects.

Side projects help but they might infect your work life. No idea on the chemistry here :)

So in short: get endorphins into your brain in any way you can (that's not addictive).

I'm not a doctor, this isn't medical advice!

[0] [2009-01-23 01:44:38] Robert Gould

Rubber keyboards so you don't break your skull :)

[0] [2009-01-22 22:05:40] Stefan

There are "good stress" and "bad stress". I work at a good company who really takes care of their workers. But at one point in my life i Hit the wall, hard. Combine no sleep, wrong diet, heigh weight, family with demands, work demands and deadlines not made for living people and you have a disaster. It was a couple of years ago and the company learned from it. I learned a lot from it too. I can see when a fellow worker does not feel well and Im not afraid to call the highest boss and tell whats araising. We all know here that the most value asset we have are a healthy programmer that have a good private life. Not a programmer that has to forget about the private life and work overnight to get the work done.

Im now working in an healty "stressy" environment (same company), its a good stress, Im ontop of it and know what Im doing, its my or the teams responsability to handle whatever comes up and we takes care of everything. Its not something that has been "pushed" down on us.

[0] [2011-03-26 19:56:23] Fons

this smalls tips helped me a lot:

  • develop your humor sense
  • Take time to visit your family
  • Take time to do something with your friends, (is better to go somewhere when you can talk , no just a disco or noisy bar)
  • sports ( if you can combine it with 3 previous tips will save you a lot of time ;D )
  • Take in mind that you are not superman. So its better to know your limitations.
  • Know yourself better, it takes time but it will help to predict your next burn.
  • Sometimes spend time watching those inspirational talks like the ones in ted site
  • Try to have fun.
  • Think about how ridiculous are our problems when comparing to others, or , with the universe.
  • Think that your mind its like a operating system, and imagine that you run the "top" command, and you can see wich process are taking memory and resources .. Kill the process that are not importants ... (first you may reconsider the concept of "important" in your life)

I think that your brain is not only a tool for programming ,I think we are doing a antinatural job, so be aware of this and take the nesesary rest. I think only programmers can understand the programmer burnout.

It's time to rest, and fix your mind.

[0] [2011-03-26 20:08:41] The Elite Gentleman

For me, church service & going out for social life once a weekend helps keep things in perspective.

[0] [2009-01-22 21:37:33] Spencer Ruport

I've been struggling with this a bit as well. I decided to take sailing lessons, I've begun learning a foreign language (at a community college for the social aspect) and I've been getting out and snowboarding as much as I can. There's still room for improvement and I wouldn't call any of this a solution but it certainly has helped.

[0] [2009-01-22 21:38:35] bigwoody

You know, I too had a burnout around 9 months ago.

I'd say right now I'm about as balanced and happy as I've ever been.

My solution was not too far off from yours. Eat better, don't miss workouts, take up some NON PROGRAMMING hobbies. I love my job, but burnout is inevitable if all you are ever around is programming. Go out of your way to look good and be fit, and if you pick a hobby that you can do with others, social problem is part solved (some programmer friends is also good).

I could probably write a giant wall of text on this topic, so maybe I'll watch the comments here, I'm in the mood to cover this topic for a while.

[0] [2009-01-22 21:31:11] Jim Anderson

Prayer and meditation.

Warning sign that I'm getting stressed out: increased irritability.

[0] [2009-01-22 22:48:29] JB King

Sometimes getting away helps. Sometimes finding enjoyment in some story whether it be book, TV, music or movie also provides some help. Doing puzzles and having that feeling, "Yeah, I did it!" is useful. Another point is to set reasonable goals and work towards them. Accomplishment can be a good thing though sometimes one does have to change environments if you find your workplace being some toxic to your mind.

I don't think it is stressing about the code, but rather the dynamics at work that play a big role. Is it that once you finish one thing there are suddenly three more items on your "to do" list? I had that at one place which just provides an incentive to do little to no work as any progress is somewhat punished. Or where any suggestion was met with a, "That sounds nice," and nothing else done with it that just sucked my soul.

Warning signs for myself tend to vary from intense feelings of rage, anger, or bitterness to feeling like a mountain is being put on me in terms of what I have to do. Needless to say I am being treated for depression with some good results but I'm not done yet.

If I am thinking about what I did at work while I'm going to sleep, that can be a warning sign that I'm too focused on my job. If taking a vacation day leads me to worry, "What did they do without me?" this is another warning sign that I may think too much of myself. If in discussing what I'm working on, I get worked up like angry, fuming, about to turn into a gorilla and beat my chest, that is another sign of it may be time to take a day off and see what else there is to life.

Therapy can help, but the question is how well do you follow through on what is suggested or using the insights gained. For example, when I was a child there are certain phrases I would hear repeatedly and to this day if I hear them, it brings back some rage into my body. Most other people wouldn't react so strongly to this but the key is to know what I grew up with and what I didn't take like I should have.

[0] [2009-01-23 01:04:54] Breton

Kite flying.

Unfortunately I get pretty run down on long streaks of non windy weekends.

[0] [2009-01-23 01:24:20] Wagner Silveira

From my point of view is as "easy" as having a hobby. Mine for example is photography, or cooking - and latelly baby caring... :-). It helps me to shift my mind from work.

It also helps me to find out if I'm close to burn out. How? If all of a sudden, taking photos (or cooking, or jogging, or playing with the kid), is not fun anymore, and there is nothing else that replaced it, I'm hitting the bottom. Time to relax a bit.

I didn't get as bad as you mate, but I was going close to the bottom last year (pressure increasing at work, new baby on board, money getting shorter, the usual suspects). What helped a lot was a two months holiday, and rethinking priorities.

I hope you keep your mental health. I'm trying to keep mine... :-D