I agree with @sidhantpanda: the long sprints happen when you get really into code and you are on a roll and you lose track of time because you are really enjoying it. I usually don't even need to eat. Decaf if you are scared of caffeine rushes. Planning short stints with short breaks and naps are all good and well, but it takes some discipline. The nap thing never works for me... But I would usually only need nap time after about five or six hrs of heavy going, and by then, it would probably have been better to just have five or six hours of sleep and then get up, have a cold shower and be fresh for the next five or six hours of work. Don't make a habit out of it... It catches up with you eventually