Haylem's Survival Guide to Code-Rushes
- Master your Sleep
- Be Active and Healthy
- Be a Team
- Sleep!
Master your Sleep
The most important thing is to master the art of sleeping well. Listen to your biological clock and be aware of your Circadian rythm. Learn to understand your sleep cycles and sleep patterns. (Go beyong and get into Chronobiology if you must. Who knows, maybe there's an oscillating gene of the crunch-time programmer).
Once you master these, that REM and NREM phases have no secret for you and that you can write a dissertation on your friend Melatonin, you can have a good and efficient sleep over very short periods of time. Which may be critical in helping you through a hard phase.
One of the worst things is to interrupt a deep sleep cycle. It's highly counterproductive has you are not rested when you wake up, and still completely numb and sleepy. Whereas if you optimize you sleep time to "power-nap", you get the best of the benefits of sleep, and none of the wake-up disadvantages. If you have to crunch through a deep sleep phase, then fine, skip it and bit the bullet. But be sure to jump on the next one.
If you are in a situation where even an interrupted cycle can be good to grab, do it. For instance, if you are jumping on the train or bus for your commute, just lay your head down and nap (don't miss the stop though). You'll be sleepy and grumpy when you get off, but you'll be back to normal while you walk to your home or office.
But most importantly, have a good night sleep when you can.
The Necessary War Story
I had to work overnight for the past 5 nights even though I have a full-time job during the day from 9 to 5 (and actually it's more 7am to 7pm + travel time). I usually went home, played with my baby, fed him and put him to bed, spent one hour with my partner watching TV (falling asleep in front of it 2 out of 5 nights) and then napped a bit to be woken up by my alarm I had previously set up for the right time. Problem solved. BUT there's a period of the day (mid-afternoon) where my body is in a deep cycle again where it gets reeeaallly hard to stay awake at work because of the still strong lack of sleep, and I cannot nap at work. In that case, use the other tricks. If you feel like your nose is diving to hit your keyboard, get up, walk around, breath a lot (oxygenation helps!), have something sugary to boost you. And when I am done with that, a good 10 to 12 hour night gets me right back where I was before (or more: I once slept 22hours straight after a very intense week of 140 hours of work... A colleague slept 26 hours straight. Must feel weird to skip a day...)
Be Active and Healthy
Fatigue is not the only bad effect of sleep deprivation. It's only the most obvious one. You also ruin your metabolism and your body's ability to process nutrients efficiently, and by perturbing your sleep schedule your disrupt the scheduling of many other things. Your appetite and good functioning of your digestive system being another one.
You also screw up a few other things. Feel sticky and stinky during these crunch periods, even though you take showers all the time - because they also keep you awake? Well, that's normal, your perspiration system is also not happy.
Other things include cariovascular activity (slower heart-rate and low blood pressure, but evidently higher heart-rate whenever you get back into stress mode), lack of focus and coordination (you get clumsy and make mistakes all the time).
It might not be worth it. I always used to have people telling me "you can't do that, that's inefficient. You'd be better off sleeping and then working. Working while sleep deprived is counter-productive." They might be right in some cases, but in others obviously your deadline is so short that there's no going around it: it has to be done now, or it won't be done at all. It's up to you to decide.
Energy Drinks
You can always resort to energy drnks. I used to never use any, out of personal distaste and also because of side-effects and a refusal to become used to these. But now that I'm not at uni anymore and not able to go through weeks hardly sleeping more than a few hours a week, I do use some occasionally if I need a boost. Or caffeine tablets.
But still, don't use these too much. They have bad side effects (usually your stomach won't be a fan, and it's already not happy with your sleep deprivation anyway). Including dependency (coffee as well). See the Further Reading section.
There's a counter-point to the "be healthy" part: note that even if it's not always "healthy", eating/drinking will reboot your body into an active state, thus turning you back on as well (don't eat a whole turkey though, or then you go into full-sleep mode!).
have a coke, a bagel, something.
Keep yourself hydrated. Very important. Done any sport? Think like a marathon-runner!
Keep yourself fed.
And please take showers.
Be a Team
Because 2 (sleepy) brains are (potentially) better than one. Well, if you don't work with a donkey.
When working very intensive hours, I used to do it always with a very great colleague.
The plus sides:
- You check each other's code and documentation.
- You nap while he codes, and vice-versa.
- You check each other's decisions.
- You control each other's health: if one of you starts to really be a mess, the other one is the voice of reason.
- You keep each other's mood up.
- You can get stuff for each other (coffee, food...). Even if taking a break together to relax (or brainstorm idly) might be better, if you need to work around the clock, then that team work does wonders.
You need someone you are really comfortable working with for this, but the benefits are huge. Obviously pair programming is always a good thing, but it's vital in these situations.
Aside Considerations
- You might want to change your job. Except if you like/love it. But be sure that you like it more than your health.
- Try to improve your team's aptitudes and teamwork to avoid these crunch periods.
- Try to improve your office environment to make these conditions easier to deal with:
- dedicated sleeping areas (well, the floor does fine for me... but I wouldn't mind a couch!)
- no bright lights
- if you can dim said lights, then even better
- free food
- free coffee
- deals with neighbouring shops for food pick-ups
- a dedicated area for relaxation. Not the one dedicated for sleeping! Nothing worse than morons waking you up because they don't care or because they take their break and have a heated discussion about the Tannenbaum/Torvals feud.
Further Reading
PS: For the record, I come from a very intensive background, plus I used to have pretty strong insomnia issues (which I had before that career, but at times throughout as well), so I got used to dealing with sleep deprivation.