Interesting thread w/ comments about the hours programmers keep. Differs by person of course. Night-owls, 9-to-5ers, etc.
Personally, I get ideas and fix problems:
– many during 9-to-5 but also
– sleeping/putting kids to bed
Another ObPoint about leaving and coming back and “fixing the problem in 5 minutes”: It also often just works to shift gears and work on another problem. It’s not always just food/sleep/time needed. There is usually plenty of other work to be doing, so choose another problem for a bit and come back to the stuck one later.
But it’s true, like any difficult/creative work: it is quite pointless to code when tired.
see also: Relax! You’ll Be More Productive
– taking time to get adequate food, sleep, exercise, and vacations “boosts productivity, job performance and, of course, health.”