How to survive all-night coding sessions

Developer Tammy Coron on how to improve your skills as a night crawler.

In a previous post, I provided 10 tips for the work-at-home ninja. Those tips are great for the average day: eat right, have a dedicated workspace, take breaks, so on and so forth.

But what about those times in which it's virtually impossible to stick to a routine? What about those times when deadlines are looming and time is short? No worries… it just calls for a slightly different set of tips.

01. Work anywhere

All-night coding session tips

Okay, maybe not 'anywhere'…

Skip the dedicated workspace. While it's great to have a place specifically dedicated to doing your job, sometimes you have no other choice but to work elsewhere – correction, anywhere! This is especially important when you're putting in a long day. For example: if you're tired, work in bed or on the couch. While these conditions may not be ideal, they will help you get the job done.

Pro tip: If you need to leave the house, ask a family member or friend to drive. This way you can work in the car on your way to the destination.

02. Toss the schedule

All-night coding session tips

You don't need to be a slave to the planner

How long did you work today? 8-10 hours? That's good. That's a typical work day, for most. Now imagine the work you need to get done will take 18 hours. What then? Should you space it out over the next two days? Well, that's an option. Unless, of course, there's a pesky little thing called a deadline.

I don't advocate for long hours, all the time (despite the fact that I often do work them myself). But there are times when they're unavoidable. In those situations, I recommend you ditch the clock, put your head down, and tend to whatever task is required in order to get the job done. You can come up for air later.

03. Limit distractions/breaks

All-night coding session tips

It's easy to fall asleep during breaks

Yup! You've heard this one before. Don't let yourself get too distracted; especially when you're working late. One minute you're taking a five minute reading break, and the next you have drool all over your keyboard because you fell asleep at your desk (while reading!). That's not good for you, your work, or your keyboard. Stay focused. Stay on task. And keep your eye on the prize.

If you do need a break, limit it to something that includes some type of physical activity, like walking. In fact, that's the best type of break when you pull an all-nighter; it helps to keep your mind sharp.

04. Stay hydrated

All-night coding session tips

H-2-Oh my god these are good tips

Drink plenty of water. I can't stress the importance of keeping yourself hydrated during your all-nighter. While it's true caffeine is a great way (for some) to stay awake, it can also wreak havoc on your body.

To counteract that, have a bottle of water by your side. In between your endless coffee slurping which no doubt you'll be doing, be sure to have a little water every now and again. You might be surprised how much this helps.

05. Nobody's perfect

Except you, right? Think on…

This one is particularly difficult for me. Sometimes I find myself agonizing over a few lines of code when it would be more productive to move on to solving the next problem. The key here is that things don't need to be perfect. They need to work; they need to look good; and they need to do what they're expected to do, but they don't need to be perfect.

If your code is working – but it could be better – leave it for now, and come back to it later when things aren't so tight.

Next page: five more tips for your all-night coding sessions

Topics