I find myself playing a video game every 1-2 hours of programming to have a break. After playing for a few minutes i go back to coding. Sometimes i surf to websites like this or visit other blogs.

What do you do?

+12  A: 

I usually:

  • Have a walk outside
  • Do something useful around the house (I work from home)
  • Do some physical exercises.
Rinat Abdullin
+2  A: 

Drink heavily.

In all seriousness, I play video games, play with my children, and get up and get some fresh air.

+8  A: 

One of the following:

  • See my girlfriend
  • Read about programming
  • Go on a walk
  • Watch something on Hulu
Evan Fosmark
"See" your girlfriend. Now, isn't THAT subtle :)
Andrei Taranchenko
Lol, nice one Andrei. =P
Evan Fosmark
+2  A: 

I usually don't take breaks unless I am stuck on a problem. Otherwise I'll break the flow I am in.

When I am stuck I'll usually go home or just get up and do something else. I find that subconsciously my mind is freed up to think about the problem and a solution just comes to me that way.

+1  A: 

At home I play EverQuest 2. Ironically, it makes me think about programming.

At work, I read Stack Overflow, my RSS reader, and occasionally, switch to a paperback I've been reading for a while.

Robert S.
How does it make you think abt programming?
Click Upvote
Things happen in the game and I wonder how the algorithm is implemented, like how damage is computed based on buffs and debuffs.
Robert S.
just curious, what paperback are you reading now?
Gates, by Stephen Manes and Paul Andrews. This is my second time through, having first read it in 1994.
Robert S.
+4  A: 


Otherwise read my RSS feeds on igoogle.

+58  A: 

I would recommend some physical activity! We have a ping pong table downstairs in our office and I usually play a quick game when I need a break. Otherwise I walk down the street to get a coffee and some fresh air. Getting your ass out of the chair and your eyes off the monitor will get your blood pumping and probably reduce eyestrain.

+1 for blood pumping
everyone is copying me
Click Upvote
+1 for everyone is copying me.
LFG snowboarding
+1 for coffee addicted (but should be cappuccino) ;)
stop copies me! -Toki/Skwisgaar
+32  A: 

I usually go for a walk, hug my kids, or talk to ACTUAL HUMANS. Basically get out of the cave.

Scott Hanselman
+1 for out of cave
Click Upvote
+8  A: 

Distance running. 6 miles at sub-eight min/mile pace clear out anything in the brain :)

+6  A: 

Don't underestimate even the simplest of physical activities, such as walking. It gets your blood pumping, as in "into your head", and then you come up with great ideas. Boom!

Andrei Taranchenko
+1 for this. I've found my ability to come up with actual ideas (rather then 'grunt' work) is enormously improved after exercise.
+11  A: 

Smoking, unfortunately. Don't be an idiot like me, take a walk instead.

+1 for the advice!
Yeah, unfortunately, I smoke too, so I have to up-vote it, although I don't recommend it. I should quit someday... :/
Paulius Maruška
Click Upvote
Make 'someday' today, else it'll never come.
smoking is actually the only way to talk with my coworkers. i'll never quit.
alfred barthand
I have quit for years, startup again, quite again, etc.
John Isaacks
+1  A: 

Smoking It's a bad habit but at least you meet people from other departments.

+1 for the LOL, although I only smoke when I'm having a hard time with something so, I'm usually not in the best mood when I meet those people.
+2  A: 

Try something less technical and more creative. Study art - try your hand at drawing. Photography is easy to start with.

+22  A: 

If you're not walking away from the computer you're really not taking a break.

Robert Rossney
+1  A: 

1) Surf MathWorks/StackOverflow

2) Kongregate!!!

3) Listen to some death metal (I just got the Dethalbum!)

+31  A: 

StackOverflow. I'm actually taking a break from coding right now ;)

Stephane Grenier
+4  A: 

I'm surprised nobody has mentioned walking the dog yet.

Definitely, how could I forget this one!
don't get it? are you guys working from home? :P
Programmers usually have cats it seems.
Evan Fosmark
melaos: You mean, you don't sleep in the office? ;)
BTW I'm sure that my cat would despise me ever more if he realized that I do programming for a living...
haha, not since my high walled cube was replaced with this long desk separated by a plastic short cube like wall... :)
+2  A: 

Will have a cup of coffee or tea

...alternatively during cold wintery days, I'd suggest a hot cup of cocoa.
+1  A: 

Go to reddit funny and have a good laugh. and break to get a drink of water or to the bathroom. and sometimes to youtube for some funny videos, short ones so i can get back to my flow later.

+3  A: 

I eat cheerios.

Luca Matteis
+10  A: 

Flying. There's nothing like a strong crosswind on final approach to take your mind off of programming :-)

Otherwise, I like to go running. It seems to restore a lot of the things that sitting in front of a computer all day will take away from you.

Robert Venables
+1 cause I have to agree about the strong crosswinds taking your mind off of programming... nothing like a "near-death" experience or two to get me back at my desk quick.
If strong crosswinds have that effect then either they're simply too strong, or you're spending too much time at the 'puter and not enough time flying.. :)) Anyway, xwinds are only interesting in the flare, not on final... ;-)))
Now go take some acro training...
+1  A: 

I would:

  • Exercise for good health (our company has a gym)
  • Coffee or cocoa break (our company has a Starbucks dispenser :)
  • At home, play video games or play Texas Hold'Em Poker
+32  A: 

Office pranks on your colleagues...priceless.

I.e. put sticky tape under their mouse and watch as they move their mouse and nothing happens. Then they check the pc connection and bang on the mouse. Then they finally look under the mouse and realise someone has stuck a piece of paper to block the infared light.

rofl! Best one so far
Click Upvote
One more reason for me to stick with my old fashioned mechanical mouse
@Treb, it's called taking your ball out.
My version of this was to write a pgm that moved the mouse cursor around randomly :-)
Even better, stick one of them small wireless mouse USB-thingies in one of the USB-ports on the back of their box, and move thier pointer sporadically
People still use mice?
You can get killed by software developer if you'll do it before deadline.
Yet another reason for using a trackball. ;-)
Dave Jarvis
+2  A: 

I usually do one of the following:

  • Have a cup of tea and read a book
  • Go for a walk or to the pool
  • Cook
  • Have a shower (sure it's a waste of water. but I do my best thinking in the shower)
Kevin Loney
+3  A: 

Unreal Tournament 2004 !

Scott Evernden
NFS Most Wanted !! ;-)
+8  A: 

Usually I stand up, stretch for about 10 minutes. Do some squats and lunges, get the blood flowing again. Remember that sitting for long periods of time (more than 1 hour) is just like lying down for too long, and you can get blood clots. Crack your back, do some jumping jacks, whatever is good for you. At my job, we are free to do whatever we want, so every hour I go outside, walk to the corner store, have a smoke (don't smoke if your not already addicted), talk to the clerk for 5 minutes, shake my legs a bit to get good blood flow, and all the while i do brain exercises on my iPhone. About the clerk at the store though, she is very good looking, and believe it or not, that can get your blood flow going again. Also, I take Centrum Cardio and an Aspirin everyday. No matter how much you love your job, or love to code, you have to stay in good health.

EDIT: Also, I am 21 years old, and I have a heart condition and a missing bone in my ankles, so I can't run (I can bike, though). It is important for me to do this. It's important for you too, so you don't develop an illness. High cholesterol or thick blood is nothing to play with, no matter how good your job is. Keeping the muscles active and in working order is important for doing your job well and feeling good. I drink 1 or 2 shots a day, which actually LOWERS your chance of a heart attack, stroke, or clot, but more than that or starting to drink if you never have can just make it worse.

hahahaha.. i could just see it coming about the clerk
Click Upvote
haha yea...its true though!
  • Come here
  • Read feeds
  • Smoke + coffee
+1  A: 

When I am not coding and find some spare time between performing house chores and playing with my kid, I usually grab one of the programming books and start to intake the softaware development knowledge. I might be in the minority in this regard, but this is a very mind refreshing and empowering experience that insatiates my software learning desire.


I usually go for a walk in the park. On sunny days I'll grab a big cup of coffee and smoke a cigar outside.


Work out for a small while, do some push-ups or sit-ups. Then have a cup of tea.

Bartosz Radaczyński
+2  A: 


Wait, what do I do to take breaks from programming?... Well, that's just crazy talk.

Adam Bellaire
+3  A: 

At work its Foosball, if its physical (however small) i think it helps out.

Yeah, we have foosball table at work here too. It is used a lot during breaks by the developers and it is physical activity. You may think it's not a lot of exercise just by looking at it, but it does break some sweat.
+1  A: 

I eat toast
I have a mug of tea
I chat on MSN/Twitter
I have a mug of tea
I nap

you must be british?
Click Upvote

Play drums (if at home), great way to get the blood flowing an energy levels to jump up.

Kyle G
+1  A: 

Unfortunately at work there's not much you can do, but I sure try to stretch the legs a little, and most importantly, relax the eyes a bit by looking at some distant point for a couple of minutes every hour or so (in order to prevent that Computer Vision Syndrome or CVS thing).

+1. I like the distant point one; never thought of that.
Johannes Jensen

I make chocolate milk or go to the gym if I really want to take a break

+1  A: 

I start the Yahoo messenger and i will be chatting.


Oxygen. Brisk walk. Yard work. Get out of doors. Turn over some 02.

Meditate. Focus on the breath. Nothing fancy, just follow the breath.

Both are hugely refreshing.


I play Doom (the original).

Anthony Cuozzo

Play video games. Just relieves a lot of stress and I end up clearing my mind.

+2  A: 

Go surfing (in the ocean) It keeps me sane

+1 for having read through most of the answers but I hadn't gotten one about water sports yet.
Johannes Jensen
+1  A: 

Some things I do:

  • skateboard cruise around the block (current favorite)
  • brew a cup-o-joe
  • throw a game of 301 darts (board in the office)
  • drive to Panera and work there for the rest of the day (nice if you work at home and have a Panera close by)
  • grab a snack
  • pet the cat
  • read a magazine
  • walk to get the mail
  • lay out on the couch
  • grab a few minutes of discovery or history channel on TV
I like discovery and history channel...when I can't find something to watch (on my 300+ channel cable subscription) those are great fallbacks. I actually keep one of the Discovery channels on by default.
Mike Brown
Awesome, Mike. Aside from a few specific shows on other networks I find it easy to turn on Discovery or History and be entertained by almost anything they have on.

Stack Overflow!!

Mark Harrison

I find either a hard work-out (blood to the brain) or, when I have time, a few hours at the Trap or Sporting Clays Range. Programming, with all of its close-up work, is hard on the eyes and the Clay Sports are ideal for training them to focus at distance.

Mark Brittingham

Speaking of pranks, I had fun with an annoyotron from ThinkGeek. There were about 16 people within hearing range of it because of acoustics. Took half a day before it was uncovered.

Which brings me to how I got the annoyotron. I was recently inspired to learn guitar because of rock band. So I purchased an iAxe USB guitar from think geek. Also picked up the Hal Leonard Guitar Method pack...you would have thought I single-handedly programmed an autonomous vehicle from my excitement when I learned to play a simple melody on the first string.

Mike Brown

I like to play DotA.


I go to the restroom.

I can't tell you how many problems I've figured out while staring into a urinal. I find getting away from the problem and thinking about something else allows new "outside the box" solutions to pop into my head.

+1  A: 

I'll usually do something mindless like check Facebook, or play Robot Unicorn Attack.

+1 for Robot Unicorn Attack.
Johannes Jensen

Yeah get out of the monitor and give some rest to your eyes. Can we do anything without eyes???. Need to give them some rest for sure. I would love to work in a setting with a natural lighting (like a open window) so your eyes and body will feel some new life in it.