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.

Being a programmer is not a very healthy profession - long hours of sitting in front of a computer, with impending deadlines just over the cubicle. This takes a toll on the body and mind.

So what tips do you have for programmers in order to stay healthy?

share

locked by World Engineer Jul 26 '13 at 19:54

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

closed as off topic by Jon Hopkins, Walter Jan 10 '11 at 0:22

Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
@TomWij: Really? I thought if I didn't make this a community wiki then I would have been flamed with "You're just asking this to get reputation!" –  gablin Sep 20 '10 at 9:30
10  
The same way anyone with a desk job stays healthy! This isn't really programmer-related? –  Peter Boughton Sep 20 '10 at 9:39
10  
I deny the premise of the question. Programmer's don't stay healthy ;) –  Joren Sep 20 '10 at 14:38
1  
@Joren: My co-worker who runs her own Tae-Kwan-Do studio would disagree with you. (Ooh, that's my tip! Run your own martial arts studio! Uhm, might not be generally applicable, though....) –  BlairHippo Sep 20 '10 at 14:40
3  
How do elephants stay healthy? –  Job Jan 8 '11 at 1:34

17 Answers 17

  • Join a gym that is close to work
  • Walk/Bike to work
  • Drink a lot of water at work (increase your water intake, and force you to take break to use the washroom, win-win situation)
share
  • Eat well: Not going for fast food a lot and drinking water or other healthy drinks can help. Variation!

  • Take pauses: Preferable using the pomodoro technique... After every 25 mins, take a 5 min break.

  • Keep yourself fit: In your free time you could go jogging, if boring do sport or take dance lessons.

  • Sit well behind your computer: 90 degree angles, adjusted heights, sit straight, ...

  • Sleep well: Helps in a lot of aspects: Being healthy, energy, less stressed/tired, productivity, ...


If you are a perfectionist you could implement the pomodoro technique, watch your calories,
think about improvements in your daily activities (eg. stairs instead of elevator, try to do things less lazy), ...

share
6  
+1 for Sleep Well –  pramodc84 Sep 20 '10 at 12:06
2  
Try to sleep well with two kids mate :).. –  systempuntoout Sep 21 '10 at 9:29

A lot of people propose cardio here, but I will take a different route and recommend strength training. Compared to the former it has the following advantages:

  • Improved posture and strength: When you get stronger sitting, walking and standing with good posture will become a lot easier, will feel more natural and you will start to do it without constantly reminding yourself. Other common task like house holding or carrying objects will get a lot easier as well.

  • Permanent fat loss: Strength training will increase muscle. And one of the benefits of increased muscle is an increase in the number of calories your body naturally burns at rest. In addition to this your body will burn calories during the weight lifting session and will require additional calories to repair your muscles after it. These three effects in combination work really well: When I started to lift weights I became a lot stronger and leaner within a few months without changing my diet habits at all.

  • Less time consuming: 3 x 45 minutes per a week is enough.

  • Increased motivation: Pure cardio tends to be boring and repetitive. If you take strength training seriously you will try to lift more weight, perfect your technique and try to break your own records every workout (and if you just started to lift weights, you will most likely break them every workout). If you are a gamer, you probably know this kind of motivation from RPGs, where your character get stronger from level to level.

  • Various other benefits: Strength training increases endurance, bone density and testosterone levels. It also strengthens your joints, lowers cholesterol and improves your sleep.

  • It will make you look good: Strength training will not only make you leaner, it will add muscles to your body as well. You won’t become a body builder or anything close to that. You will look athletic and in shape.

If you want to start with strength training, I recommend you to read Stronglifts as an introduction. It is a great site that will offer you everything you need as beginner: Workout programs, articles about exercise technique and nutrition advice.

share
1  
+1, though do note there's nothing either/or about strength vs. cardio. As long as you're in workout clothes and sweating anyway, why not hop on the treadmill for fifteen minutes? –  BlairHippo Sep 20 '10 at 14:26
4  
@BlairHippo: I agree. This was not meant as an either/or post. Aerobic and anaerobic training have their strengths and weaknesses and a combination of both is great. I was just pointing out the advantages of strength training, because hardly anybody knows about them. –  xsl Sep 20 '10 at 14:49

I'm 54 and weight is a problem. I run 3 - 4 days a week... try to do some kind of workout every day. I also have to watch my calories - try to stay under 2300 a day. Seems to work. I find that I can concentrate better for longer periods with exercise.

My advice would be to do something every day. Walk, ride a bike, strength training. Some of us need variety. Use physical activity for your break from the machine. Once you're in the habit, you won't even think about it and you might even like the way you feel.

share

The same goes for programmers as it goes for pretty much everyone else ... watch your intake (most people today - even the skinny ones - take lots more in then they need) and do some kind of physical activity (swimming, running and cycling for example).

Now, most would say ... I haven't got the time for that. - but it is all questionable. For, programming is first thinking, typing second (or third) - you haven't actually got to be at your computer all of the time to do your work, as long as you can think of it (this has some issues with certain people, but if you show you're good at what you do they usually agree that they don't have to make you sit on your chair all the time, for you to do your job) and have the mental capabilities to visualize it in your head (most do).

... all there is to it, really. People are ment to move and have been moving for several millenia now ... no magic in that area (in regards to food, diets, whatever) will let them stay healthy if they sit on their respected ones all they long.

p.s. Laptops help ... you can work in several places (e.g. from the garden at home, ... can easily rearrange your office at work ... Hell, you can go to the mountains in your car, just find a nice place, lay somewhere and enjoy the scenery and work ...)

share

Read The Hacker's Diet. It presents an engineer's approach to exercise and food intake.

share

Use an adjustable-height desk if you can get one. Being able to work standing up if you feel like it is a great help.

share

There is some great advice already listed in these replies. I wrote a post outlining some of the things I tried when I decided I had to improve my health and lifestyle. I hope it's OK to post a small extract here:

Eat smart

This is the most important point in this post.

Nothing else will have as big an effect over the way you feel, your mindset or your successes.

I began to eat lots of fibre-rich, high-quality foods, especially those that are only made up of a single ingredient (i.e. veggies, fruit, nuts).

I forced myself to cut out processed foods, too. It was tough (very tough!) but I realised if I wanted to make any progress, I had to do tough things.

Also, be aware of your sugar in-take. It’s criminal that many ‘low-fat’ foods are then pumped full of sugar because sugar makes you fat. Sugar is best avoided the majority of the time (fruit doesn’t count!).

One thing to remember is that any changes need to be sustainable. Introduce changes over time and you’re more likely to stick to them.

Drink more water

If you’re anything like I was, you’re not even thinking about drinking water… In fact, you’d happily drink anything but water (coffee, can of coke etc).

Seriously, avoid liquid calories like the plague if you’re looking to lose weight. They won’t fill you up so you’ll always be wanting more, it’s expensive and it’s not good for you – and you’ll end up with teeth like mine!

Start to graph your weight

“What gets measured, gets managed.” - Peter Drucker

Tracking your weight can be a huge motivator for anyone looking to make gains. If you do this every day, you can graph changes over time to make sure you’re heading in the right direction.

Do the right kind of exercise

Often when people say they want to 'get in shape', they mean that they’re going to drive to the nearest gym (which is usually at least 15 minutes away) where there’ll spend anything up to 2 hours pounding away on the treadmill. For what?

So that they don’t feel as guilty about all the junk food they’ll eat when they get home?

I tried bodyweight exercises combined with interval training. I could get more done in less time.

Also, be aware that you don’t need to train five days a week. In the beginning, it’s useful to aim for two or three as long as you’re staying active on your off days (and by staying active I mean walk around more, play sports, jog if you can’t resist it!).

Get more sleep

This was the toughest change I had to make and it probably will be for you, too.

Everybody knows how important it is to get enough sleep but the trouble is it is so easy to go without. There’s always another hour to squeeze in some more work but then we’re left scrabbling around in the morning, rushing into another day. When I realised it didn’t have to be this way, it was a massive weight off my shoulders.

Make it social

If you make your fitness goals public then not only will you get support and assistance from others, you’ll get accountability.

I managed to convince a mate that we’d begin exercising together. All of a sudden, it became a lot tougher to drop out. Try it. They will be somebody you know desperately waiting for someone to take the lead.

share

Ask your boss for one of these ;)

alt text

share

Over my last school semester (6th semester of Electrical Engineering) I managed to stay somewhat in shape by doing intense 20 minute workouts daily or every second day. Also, cutting out fast food and any kind of soft drink (soda, etc).

share

Zed Shaw has written a good article on common programmer health problems.

share

Drink a lot of water, dont eat a lot, snack on junk food evenly or less then snacking on fruits/veg in the fridge (many times i have them precut).

I do that and i LOSE weight and i walk < 1hour a day. This is impossible? Well almost. I break even much of them time the days i go out and walk the streets i come home 1/2 pound lighter. I always feel energies and the water helps (I drink 3L a day bro ;P. No joke)

share

BREATHE WELL.. Learn some breathing Yoga..

DRINK A LOT OF WATER..

I am telling the above as a lot of other things like Cardio/Sleep/Diet have already been mentioned. I was once a Gym freak so I know the benefit of all these but at a much later age I was introduced to Yoga and noticed that breathing patterns really improve your productivity. How about the fact, that if you breathe well you might sleep a couple of hours less and have more energy throughout the day.

share

They write an intentional bug in The Matrix that subtracts all calories from Jolt Cola from their daily intake. And you always thought it was because of the caffeine!

share

Lot's of good advice in previous answers. But I think young people have a false sense of security when it comes to health and don't realize that if you don't have good habits now, it will be tough to change when you get older. If you like to run, keep running.

share

Two words: Treadmill desk. It took some doing to find the right cheap treadmill on Craigslist and figure out how to fit it with a desktop, and I'm still getting used to it, but already my nagging back problems are becoming less nagging. And I don't have any more trouble fitting exercise into my work day than I do fitting work into my work day.

share
  1. Set concrete, measurable fitness and diet goals.
  2. Track progress daily.
  3. Share with others.

Tracking everything not only satisfies my "data junkie" side, but sharing it with others - and having them encourage me and keep me honest - is a huge motivation. This approach has allowed me to make some incredible gains in my fitness and health despite sitting in front of a computer 10 hours a day.

To use myself as an example, I do Crossfit (by far the most effective way to exercise I've ever found), set goals each year on my blog and track every single workout on a messageboard. For diet, I currently just try to follow the advice in In Defense of Food and eat only whole/unprocessed food in a roughly Zone Diet 40/30/30 breakdown, although a couple years ago, my diet goals included losing 43lbs, which I managed to do in ~8 months.

share

Not the answer you're looking for? Browse other questions tagged or ask your own question.