You can’t survive without sleep. After missing a night of sleep or just getting a bad night of sleep, you’ll struggle to function. The effects of sleep deprivation are extensive and significant. When we’re tired, we’re less engaged with our work, and it’s more difficult to establish and maintain focus. Our memory suffers. We’re less patient and more irritable. Anxiety increases. Our immune system weakens. Our reaction times slow down, and our brain simply doesn’t function as well. None of these effects bode well for our ability to focus and get work done.

If you aren’t getting enough sleep, not much else matters. You can use all of the other focus tips in this book, but you’ll be short-changing yourself. Sleep is where it starts, and it’s not purely about the quantity of hours. The quality of your sleep matters just as much.

With software development, the effects of sleep deprivation multiply. In a study from 2018, developers who missed a night of sleep were 50% more likely not to fulfill the requirements of a specification than those developers who had a full night of sleep. They also saw a 44% decrease in engagement with their tasks when developers forewent a night of sleep. Furthermore, they noted that the sleep-deprived developers spent 54% more time fixing syntactic mistakes than developers who had regular sleep. And you don’t have to stay up 24 hours to feel these effects. Low quality sleep can affect you in the same ways to a lesser degree.

Most programming tasks require juggling a significant amount of information in your head and maintaining that context as you connect the various dots. With the rapid change of software and near-constant rate of advancement and change, you’re continually learning, and that kind of learning is processed and organized while you’re asleep.

Despite all of this, it’s one of the first places we cut corners when we feel there aren’t enough hours in the day, and it becomes a vicious cycle. Our work suffers. We make more mistakes. We fall further behind. So we work more hours, and it gets worse. Even one night of lower quality sleep affects your work. The good news is that once you begin getting more and better sleep, the effects turn around quickly.

There’s different types of sleep

Talking about sleep without covering naps is impossible. Naps are great and can help you recharge briefly, but they don’t carry the restorative benefits of deep sleep because deep sleep is when our brains process, organize, and commit new information to long-term memory. So definitely make time for naps, but don’t expect them to be able to pay down any sleep debt you might be incurring. Naps make an excellent replacement for a cup of coffee, but they can’t make up for a missed night of sleep.

It’s hard to overstate the value of sleep as a restorative process. During sleep, the brain removes metabolic waste faster than while we’re awake. Specifically, study after study has shown that deep sleep plays a key role in how our brain processes and organizes new information.

Not all sleep is equal, though. Sleep happens in phases where each cycle takes about 90 minutes. During those 90 minutes, we transition between the phases of sleep, but poor sleep quality can disrupt the cycle of transitions. With that kind of fragmented sleep, our brain can’t recover, and it’s unable to consolidate the memories of the day.

These days, there’s an almost endless variety of options for sleep trackers to help you analyze and understand the quality of your sleep. If you regularly feel tired even when you believe you got a full eight hours of sleep, it’s worth investigating sleep trackers to see if the quality of your sleep is suffering.

Sleep deprivation has extensive costs

The vicious cycle created by sleep deprivation can have far-reaching and significant impacts on our ability to think deeply about a topic or learn and acquire new skills. Sleep deprivation can weaken your immune system requiring more time off to recover physically. In many cases, those extra hours of sleep you cut aren’t even making you more productive. They’re simply building up a debt that you’ll have to repay one way or another all while lowering the quality of the hours you’re able to work. So while the occasional sprint to meet a deadline can be reasonable, in the long-term, you can’t run from sleep forever.

Sleep deprivation has also shown to lead to symptoms similar to ADHD. If that’s not antithetical to increasing your ability to focus, I’m not sure what is. In the same vein, it can lead to memory lapses or loss while decreasing creativity, innovation, and your ability to learn. Increased errors and slower reaction times lead to a lower quality of work. So the time you save by reducing sleep catches up with you and requires you to work more hours correcting those mistakes. Finally, irritability increases while patience decreases. So you can be less patient with co-workers and create an environment that inhibits communication and collaboration.

But this isn’t just about the work you do during the day. With knowledge work, it doesn’t magically stop when you leave your desk. Your brain will keep at it and decide what to do with it when you’re in those deep sleep cycles. So even though you may not be able to view sleep itself as work, good sleep ensures that your work hours will be higher quality. In turn, you’ll need fewer hours to produce the same results.

This is all easier said than done, of course. Deadlines, unreasonable managers, unrealistic expectations, and so much more can create unhealthy stress and pressure that makes sleep more difficult. One study found a correlation where increased incivility at work negatively affected people’s ability to sleep because their minds fixated on the incivility long after it passed. We can counteract all this by focusing on improving two aspects. If you can’t increase the number of hours you sleep every night, you can at least strive to improve the quality of your sleep.

Get better sleep

Countless factors can influence quality of sleep, but there are a few that are particularly problematic. Our bodies naturally cycle with the circadian rhythm of day and night. Light naturally stimulates us and encourages our bodies to stay awake. At night, this can create a conflicting sensation for our bodies. We can mitigate this by avoiding things like television or other light before going to bed. Instead of watching TV, try reading or listening to audiobooks.

In addition to reducing light before going to bed, cutting back on alcohol or caffeine consumption can drastically improve the quality of your sleep. A 2015 study found that while alcohol creates a temporary feeling of sleepiness and may help you fall asleep faster, it prevents the kind of deep sleep that your body needs to recharge. Even small amounts of alcohol can interfere with the phases of sleep and your ability to wake up rested.

One of the most effective ways to get better sleep can be exercising in the evening instead of mornings or afternoon. With a good workout, your body will naturally be more receptive to sleep and recovery.

While five hours of deep sleep beats five hours of fragmented sleep, getting a full seven or eight hours of deep sleep is where you’ll find the most benefits. If you’re serious about wanting to improve focus and productivity, getting enough sleep is a critical first step. You may have to make it a priority over some leisure activities, but it will pay off in spades.

Getting enough high quality sleep will be one of the most significant changes you can make to ensure improved focus. It may initially sound too good to be true or too difficult to squeeze in the extra hours, but the impact on your waking hours will be dramatic. Sleep will set the stage for everything else we discuss and improve your ability to perform at your full potential. Without it, everything else becomes significantly more difficult.

Your next steps

  1. Monitor your sleep with a sleep tracking device.
  2. Set a reminder on your phone for a reasonable bed time that enables you to get 8 hours of sleep.
  3. If possible, experiment waking up without an alarm.
  4. If you need an alarm, try some of the newer devices that aim to help you wake up at the right time without interrupting deep sleep.
  5. Avoid screens and bright lights 30-60 minutes before going to bed.
  6. Avoid alcohol 60 minutes before going to bed.
  7. Avoid caffeine 5 hours before going to bed.
  8. Use short afternoon naps to recharge instead of caffeine.
  9. Exercise in the evening to help improve the quality of your sleep.