8

I was wondering what is the best work rhythm for the job a programmer does? I am coding all day long and sometimes I get stuck in a problem and it keeps me occupied a few hours before I realize that maybe I need a break.

Some say frequent and short brakes help you but sometimes when I am focused on a problem I feel like a break would not help, but rather loose my focus. So how often should a break be taken, and how long? The more basic question regarding this issue is comes from the fact that, you can get tons of "good ideas" ('promodo' for instance) on the net, that promise you will be more effective in whatever you do.

Are these principles good or, this is something everybody should decide for himself? I wonder if any of them can accomplish what it promises! I mean what they promise is that (if the conditions are met) it works for everybody. Are there really such principles? And if there are, what are these and how can we find them?

3 Answers 3

26

The most important thing for good programming is good sleep. It does not matter what time you program at or for how long. Whether you drink caffeine loaded drink or munch on chocolate all the time. What matters is that you have a good long peaceful sleep every few days. As someone with a young child I can tell you for a fact that lack of deep rest saps your ability to be creative. There have been studies that have shown that artist that are the most creative require the most sleep and workers in non demanding repetitive jobs the least.

6
  • 1
    I have a lot of experience with sleeping, I've been doing it all my life. I'd go as far as saying I'm a sleeping pro. I am that good. However, it's becoming scarce lately.. :( Commented Oct 19, 2010 at 9:43
  • 3
    Agree 100 %. Just to elaborate: good sleep != excessive sleep. Enough good-quality rest is absolutely essential, but idling in the bed for >> 8 hrs is almost as bad as too little sleep. When you sleep, sleep well, and when you're awake, be totally awake. Commented Oct 19, 2010 at 9:50
  • Does the time matter? I mean is it really important or better to sleep between 22:00-24:00?
    – Atticus
    Commented Oct 19, 2010 at 10:02
  • 2
    @Atticus: I don't think there's anything magical about some specific time of day/night, but regularity is important. Sleeping either 21:00-05:00 or 01:00-09:00 is fine, but continuously altering between those breaks your internal mechanisms. Commented Oct 19, 2010 at 10:18
  • 2
    I would complement your answer with food too. You just gotta have met most of your basic body function if you want to be able to think clearly. Like sleep, don't eat too much, don't eat too little and personally I'd say don't listen to those nutritionist that think they know better than you what your body need. Last one is just me and I don't say it work all the time (some day you will feel tired no matter what) but I would never do otherwise anyway.
    – n1ckp
    Commented Oct 20, 2010 at 22:56
2

...works for everybody. Are there really such principles?

No. It can be proved with a single counter-example. In the end you have to find out what works for you.

That said, regularity and rhythm are usually good in the long run, and there are ideas that tend to work for many, if not most, people. They're a good starting point to start fine-tuning what works for you. For example, there's Pomodoro Technique that essentially creates a rhythm with 25-minute sprints plus 5 minute pauses. For me it works fine when I need to do something not-so-engaging, but once I'm in the flow, I'm definitely not going to pause at an arbitrary time because some technique suggests I should.

1

I like the natural rhythm in pair programming.

That is, you program for a while until you feel somewhat tired, then switch and let the other person continue. This gives you a break from the physical coding and switches your focus from syntax/writing to planning and look-a-head. It keeps your mind refreshed. At least for me anyway.

1
  • Makes me miss my undergraduate days.
    – Chris
    Commented Oct 19, 2010 at 11:09

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