Short answer
Recharge your brain:
- Get some brain food, e.g. eat a banana.
- Power-cycle your brain: take a power-nap.
- Get some air into your brain, e.g. walk around the block.
- Get back to work.
- Observe your own successes/failures, i.e. note what works for you.
Read on for a longer answer.
Observe yourself
One key to answering this question for yourself is to observe yourself each time you work long hours, and note what worked and what didn’t work. This is how I’ve found out what works for me.
Physiology
Food
Your brain consumes glucose, so if you don’t eat every 3 or 4 hours, you’ll get low on brain energy. So eat regularly: breakfast, lunch, dinner, 9pm, midnight, and 3am if you have to.
Secondly, your diet is hugely important: eat low-GI food. Do not believe any advertising that says bread, pasta etc. is low GI; in my experience, that’s rubbish. Meat and nuts are low-GI; carbohydrates are not low GI. Why avoid high-GI food? Because for the first 30 minutes you get very high on energy, but then you get very tired after that, making you very drowsy and unproductive.
So my preferred lunch consists of salad, fish or some meat, nuts, and an orange or a mandarin – low GI. Bad lunch: bread, pasta, potato, apple.
Appropriate drugs (endorphin)
However, there’s a place for a high-carbohydrate meal, and that’s where you can get a dose of endorphin by taking a power nap – anything from 10 minutes to a full 45-minute sleep cycle. Even just lying on the floor for 10 minutes can give you a power boost. For me, 10 minutes on the floor gives me 2-plus hours of high alertness afterwards; it works much better than 2 hours of drowsiness I get by trying to fight my body’s rhythm by just working through the drowsiness. Observe what works for you and go with that.
To really tip the scales in favour of getting a power nap, eat a protein-heavy breakfast (e.g. meat, eggs), a carbohydrate-heavy lunch (pasta, bread, apple), and then after lunch you’ll be very drowsy; do not fight this; take a siesta, get that refreshing rush of endorphin, and when you get up, you’ll have essentially given yourself a second fresh morning-start alertness to your day, effectively giving you TWO productive mornings in one day.
THEN, for the rest of the day, snack on fruit so that you keep your energy up, and don’t sap it with any heavy food. Ask a doctor or dietitian for more accurate and detailed advice on this; I got this plan from a doctor, but I may have some details inaccurate.
Many people prefer to counter their body’s natural rhythm by taking caffeine, but my drug of choice is endorphin: I prefer a short siesta instead of an afternoon cuppa. However, living in the Western world, I find it very hard to do this when other people are around. Another reason I dislike caffeine is because it stays active in your body past the time you want it, i.e. it works to keep you awake when you finally want to go to sleep, so you wake up tired the next morning and need… more caffeine – it leads to a self-perpetuating cycle of sleep debt. That’s not how I want to live.
Air
Besides food, your brain needs oxygen, and lots of it. I suspect that the period for productive brain activity, in the short cycle, is about 15 or 30 minutes. So you will find you actually perform better if you do something counter-intuitive – step away from the keyboard for a few minutes every so often and get some exercise! I often take a walk around the block, which also gives my brain some air – very important, and if it’s daytime, I get some sunshine – very important in winter to help prevent me getting the winter blues.
Other things you can do:
- Take a shower.
- Play catch with a soft ball with a co-worker for 5
minutes.
- Just do 10 or so push-ups - it’s really short, intense, gets
the blood and air pumping, but you don’t lose track of all those
programming items that you need to hold in your head.
Alpha mode
One of the benefits of physical activity is that your brain often switches into alpha-mode, where you can "see" whole problems and answers to solutions. This often happens in the shower, when just waking up, or when exercising. I have solved so many bugs at the gym during lunchtime.
Psychology
Then there’s the emotional side of being productive – being pumped, positive, and enjoying the work. What I’ve found works for me has become a list that I use like a recipe; here’s my technique:
- Clear the decks - get annoying things in your head written down,
scheduled or done, and out of the way.
- Prevent interruptions - get
comfortable - not hungry, not full; put up Do Not Disturb signs or
body language.
- Tune out and focus.
- Get your emotions pumped -
imagine the success. Getting pumped can include listening to good music, thinking hopeful thoughts, people contact planned/done, ...
- Understand the task, the issues, materials/code.
- Think through what you're going to do. Envision the goal and steps. Plan your approach; write down the steps/task list.
- Do it - do the work.
- Rest and refresh yourself, and enjoy the fruits of your labor.
Whole being
You can consider yourself to be like a car with several power sources– emotional, spiritual, mental and physical. Each one has its own “petrol” tank. For peak energy, all of them need to be loaded up and going well. You might be physically fit and well, but emotionally broken; this will really impact your work – you need to spend time on your relationships and have some alone time. You might be emotionally well but spiritually bankrupt – you need to reconnect with God the creator; you could even pray and ask for help. Or you might be physically low – you need to exercise and maintain your body.
Source: Reading Your Gauges by Bill Hybels So you need to read your gauges and fill up the tanks that are low.
Lastly
Avoid distractions and procrastination. E.g. don't spend too much time on StackExchange like I just did.
9
If you were working less hours, you would be more productive. Excerpt from Peopleware - "It has been our experience that the positive potential of working extra hours is far exaggerated, and that its negative impact is almost never considered. That negative impact can be substantial... and "Extended overtime is a productivity-reduction technique, anyway. The extra hours are almost always more than offset by the negative side effects. This is true even if you don't consider the disruption of the team."
– None – 2013-06-09T17:50:45.1339@JeffO: not true and slightly uncalled for: the need to work more hours to complete this particular project may have absolutely nothing to do with the OP's own productivity at work, but may be consequence of others' lack of productivity (possible, but not that relevant) or a clear sign of bad upper-level planning (very likely, very relevant). – haylem – 2013-06-09T17:51:49.927
why did this get moved from programmers? i didnt have a productivity account and this question was specific to programming. i wanted a answer by programmers for programmers, not general purpose productivity. – Justin Meiners – 2013-06-09T20:38:48.640
@JeffO that assumes im the only one making decisions, I have full control of the project, the project was scoped correctly, and It is not dependent on external factors. Silver bullet answers sound nice, but show that they are no backed by industry experience. – Justin Meiners – 2013-06-09T20:42:22.780
4Justin - I would assume it was moved because it was not wanted on programmers. The productivity community here has programmers as well as a wide range of other individuals and this question is really not about programming, so I would wait and see what answers you get. – Rory Alsop – 2013-06-09T21:31:06.340
@JustinMeiners: In all fairness, no, it's not specific to programming at all. It's a rather generic issue. However, I was wondering if Workplace site wouldn't have been more appropriate though, as it does relate to productivity within the workplace and not just personal productivity. – haylem – 2013-06-09T23:29:49.990
@RoryAlsop: Would The Workplace SE site have been a better place though? It's not necessarily about only personal productivity, but about productivity in a professional setting. I don't really know, just a thought. – haylem – 2013-06-09T23:35:25.263
@haylem It is true the same problem may apply to other intellectual industries, what I meant was I specifically wanted advice from programmers. – Justin Meiners – 2013-06-10T04:12:07.107
@JustinMeiners: unfortunately that's not a sufficient requirement to qualify for P.SE :) (but I suppose a lot of people still are from the same crowd, don't worry, me included). – haylem – 2013-06-10T04:35:26.300
Please indicate in your question that you specifically wanted advice from programmers – raindrop – 2013-06-10T06:57:21.853
@haylem - I can't find my post, so I'm not sure exaclty what I wrote, but MichealT indicated less hours would make you more productive. Maybe I didn't come across that way? – JeffO – 2013-06-12T20:57:31.577
@JeffO: yes, MichaelT posted something in that direction shortly after, and no, you didn't come across the same way at all. MichaelT explained that working less hours might make someone more productive, while the way your comment was reading you were saying the OP himself was responsible for the lack of productivity perceived on the project. Something for which we had no indication. – haylem – 2013-06-12T21:33:32.990