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.

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?

share|improve this question
add comment

closed as not constructive by MichaelT, Glenn Nelson, GlenH7, Robert Harvey, World Engineer Mar 8 '13 at 22:36

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers

up vote 25 down vote accepted

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.

share|improve this answer
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.. :( –  dr Hannibal Lecter Oct 19 '10 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. –  Joonas Pulakka Oct 19 '10 at 9:50
    
Does the time matter? I mean is it really important or better to sleep between 22:00-24:00? –  Atticus Oct 19 '10 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. –  Joonas Pulakka Oct 19 '10 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 Oct 20 '10 at 22:56
show 1 more comment

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.

share|improve this answer
    
Makes me miss my undergraduate days. –  Chris Oct 19 '10 at 11:09
add comment

...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.

share|improve this answer
add comment

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