Brain games? A special diet? Exercise? Staying drug free? Sex? Abstinence?

What's your secret?

26 accepted

Feeling Good!

The only time I can program is when I feel good enough to program. By not having enough sleep, skipping meals, or loading my body full of caffeine and junk food I reduce my ability to keep up with hectic schedules.

Our bodies were never intended for sitting around in front of a keyboard, so I try to exercise whenever I can. I also ensure that I fit healthy food somewhere into my day, as well as a few litres of water.

Other than feeling good, it is important to keep focused on the task at hand. If I've done well, then I'll reward myself by checking SO or going onto the BBC News and Sport pages.


I bike to work every morning (weather permitting, no biking in the snow). The exercise helps to wake me up, and keeps me in good health also.

Healthy body === healthy brain.


Proper amount of sleep.

... and mountain dew.


I've got one trick to get me back into workflow every morning. I just keep some easy task undone from the evening, so when I get back to work next day, I can do it real quick and get that nice feel of a winning. Works better than energy drinks anyway.


Exercise really helps, I feel much more alert for exercising at lunch time. But for some reason it still requires a lot of will power to actually do it!

  1. Lots of (or just enough) sleep.
  2. Quiet place to work.
  3. Energy Drinks (my favorites: Full Throttle & Bawls G33k B33r)
  4. (If possible) Something fun to work on (even if it's just a distraction to work on every once in a long while)

Coffee is acidic drink in nature and can cause metabolic disorder over long time of use along with other unhealthy nutrition choices.

Tea is a (much) better alternative, especially green and white teas (less acidic, about 1/4 of the caffeine), which have other good health benefits, including rich amounts of anti-oxidants.

Yes, caffeine has been linked with better concentration, although it can cause hyper-activity and other conditions. The affect of caffeine on individuals is obviously dependent on each person. Wikipedia has a good article on caffeine.

Try also some meditation techniques. I can say from my own personal experiences that certain music and sound clips sharpens the state of my mind. Check http://www.i-dose.us/ for those.

Nutrition (food and drink), proper rests and exercise in-between sessions and some memory exercises (puzzles for instance) help radically too.


Coffee keeps my brain in shape!


sleep, eat breakfast, coffee. Coffee. Lunch. Coffee.


No coffee, perhaps tea. Good sleep, big breakfast/lunch. Ambient music, no clock, no internet and other things that might push your break a few minutes more. Exercise, although I have been slacking at that one. Not too funny colleagues. Less meetings. A window, to gaze into the sky and tinker.


Proper amount of sleep, caffeine, and and not having a daughter that keeps you up all night...


Exercise, juggling, and sudoku.


Coding itself keeps your brain limber; that is, the very act of writing code on a daily basis is probably all you need to remain mentally on the ball.

  • Coffee
  • exercise
  • having an interesting problem to work on
  • judicious application of pastries

Coffee, cigarettes, and code.

I find that coffee and cigarettes have their own calming ritual. Wax on, wax off, and you've got a brief window of zen rivaling any Japanese tea ceremony or yoga contortion. A few minutes to allow your subconscious to spin gears. Making a pot of coffee, or taking a cigarette break, is an inherently constrained form of procrastination.

Then there is the code. You might take a while to get the mental hamsters spinning, but so long as you are coding, you are slipping into the proper mindframe. Before you know it, you are in flow.


TopCoder and Project Euler.


No freakin joke: Magic the Gathering.

Also helps: Hacker's Delight

And, of course, reading new questions on Stack Overflow


This is very related to how do you vent stress as a programmer.

For myself doing sports, eating healthy food and some brain teasers are the way to go.


I take supplements as well, especially if I'm feeling drained. Of particular use is DL-Phenylalanine (building block for the dopamine neurotransmitter) and Lecithin (building block for the Acetylcholine neurotransmitter). Also almonds and turkey are good (building blocks for Gaba neurotransmitter). Cottage cheese is also a good source of various neurotransmitter building blocks.


Adding to the other things already mentioned:

  • Fresh air at lunch time, just a quick brisk walk outside.
  • Some kind of creative physical work at home, fixing the house, building stuff. Zipping beer on a porch you've built yourself in summer time is the shit.
  • Playing an instrument or making music.
  1. Learning something new and really interesting every day ;)
  2. Trying to speak with customers and other people as often as possible - get away from the computer screen.
  3. Enough sleep.
  4. Coffee.
  5. Holidays.

I'm surprised no one mentioned my fave



When at work I tend to drink LOT of coffee. It keeps more more focused and it makes the work day go faster. On the work days I don't drink coffee it goes by unbearably slow and I have a harder time working and keeping focused.

  1. Lot's of sleep, I get 8 every night.
  2. Project Euler, good brain exercise.
  3. Gatorade, keeps me nice and hydrated.
  4. Lots and lots of fish.
  5. A good book and/or whatever is on RMPBS.

Although I havent been actively programming for a while. I remember yoga/meditation helped a lot. Sometimes you need to completely forget everything so your brain can reboot.


"Brain games?" -- yes, also known as programming. "A special diet?" -- yes, also known as caffeine. "Exercise?" -- yes, the commute. "Staying drug free?" -- nope, see my special diet, above. "Sex?" -- if followed by sufficient sleep then it's OK, hmm, why didn't I answer that in the exercise question. "Abstinence?" -- mu.


Project Euler. Try to finish, or at least make progress on, one problem a day.


A nice brisk cup of tea and some good techno, works wonders...


Exercise, good nutrition, and supplements.

alt text

GNC Fish Oil


The biggest thing is to make sure you don't overdo it. When you find yourself saying "let me try just ONE more thing to fix this bug," then you should probably at least take a break.

  1. Staying away from the screen during my lunch hour
  2. nice cup of tea
  3. getting enough sleep
  4. music. if it wasnt for the fact that I listen to music at work I think I'd go mad.
  5. the previous point goes with a good (quiet) working environment.
  6. healthy diet, as previously mentioned.

I find getting up early and walking into work is a superb way to wake up and get my brain into gear. Quite often I find that solutions to programming problems just pop into my head while walking. I also listen to technical podcasts and old BBC comedies as I walk.

Sadly this morning I overlaid and had to catch public transport to get in on time. As a result I feel half asleep and am finding it very difficult to do anything.


I listen to development related podcasts, and read books to keep myself professionaly up-to-date.


A pack of Camel or Malboro and caffeine

...its a shame nowadays the law prohibits you from smoking indoors

I don't wanna sound like bad conscience, but cigarettes sure help me keep my cool and focused at the task at hand.

oh yea, and sex helps as well ;-)


1.lots of excercise 2.sleep 3.healthy diet nuts are always good 4.LOTS OF WATER 5.meditation 6.memory excercises 7.reading 8.listen to music

You might not be able to do all of these things in 1 day but try to do as much as possible !!!


Yeah you just got to keep healthy. Here is some of what I do.

  • Drink lots of water or my favorite, Arizona Tea.
  • Exercise at least twice a week.
  • Read the Bible
  • Read some books just for fun.
  • Have a community outside of work.

Proper diet- I'm on South Beach. Exercise - I bicycle at least 125 miles a week.
Sleep - If I don't get enough sleep, I'm a zombie.

  1. Workout
  2. Coffee
  3. Read stack overflow

My friend i keep my brain sharp for daily programming by giving complete rest to my brain and body when in work.