Get a Good Night’s Sleep –– 6 Tips for Software Developers to Rest Better

As software developers, we use our minds every day. Our talent for logical thinking is relevant to many different aspects of our lives, so we do what we must to keep our minds sharp and healthy. This might be eating healthy, exercising, reading books, or even gaming.

However, right now, in the 21st century, Americans still seem to not get one thing that’s crucial for a healthy mind: enough rest. Why? One reason is that there’s so much going on in our lives, a lot of which is beyond our control, and this influences our sleep and rest habits.

There are many phenomena in the modern world that can potentially grasp our attention for long periods of time, such as entertainment, social media, and our careers. For example, you’re on your way to bed and a TV show comes on that grabs your attention. You anticipated going to bed by 10 p.m., but because of this distraction, you end up going to bed at 1 a.m. Or perhaps you enjoy playing with the hundreds of features on your cell phone. Before you know it, hours have passed! Or maybe you receive a phone call from a friend that has the “scoop” on something or someone, and because you’ve become so curious about it, you tend to lose sleep over a conversation that could’ve waited until the next day.

These attention-grabbing phenomena are what I refer to as “The Matrix.” Granted, these things are entertaining, but when they cut into our rest, they can also be harmful.

Have you ever felt very tired, only to somehow feel wide awake again as you play with your phone or other types of computer devices before bed? This is because as you’re looking at the blue light emitted from digital screens, your brain is prevented from releasing a hormone called melatonin, which lets your body know it’s time for sleep.

As a developer, one of the best ways to ensure you can get the proper rest is to unplug from The Matrix.

Get enough sleep

It’s been reported that 40% of Americans get less than the recommended amount of sleep at night. On average, Americans get 6.8 hours of sleep, and the recommended amount of sleep is between seven and eight hours per night. For some developers, this might be more like about two to three hours on a busy day. Speaking from experience, the minimum amount of sleep I’ve gotten during an extremely busy period is six hours, or if I’m up writing code, I’d say about five. If I get only five hours of sleep in one night, I usually nap when I get home from work.

Getting the proper rest boosts mental health by sharpening your brain to remember tasks easier. If we have tasks that need to be done for a new project due in three weeks, proper rest can help us retain these tasks outside of writing notes. An adequate amount of rest also aids in decision-making—an extremely critical skill for developers, since a lot of the code we write is based on making decisions and using logic. Proper rest can also physically clear your mind by removing toxins that build up over time.

Turn off all electronics that are not in use

Unless you need an electronic device to aid in your sleeping (such as a radio app like iHeartRadio, an air conditioner, or a heater), I recommend turning off all of them. If you do happen to use your phone for a radio or music app, try dimming the light on your phone and keeping the volume low enough for you to hear the music, but not loud enough to disturb your sleep.

Spend less time using social media

Today, many of us believe that if we disconnect from social media, our lives will be boring and we will be isolated from the world. But this is definitely untrue.

Social media can be extremely addictive, and also harmful. Did you know that prolonged social network activity can cause deterioration of your ability to pay attention, and other symptoms of attention deficit hyperactivity disorder? As a developer, the last thing you want deteriorating is your attention span. This is why quitting social media for a little while may be beneficial to you. Your mind can relax, which in turn boosts your memory by protecting the prefrontal cortex and centers of your brain.

Check out the video “Quit Social Media,” by Dr. Cal Newport. Dr. Newport is a computer scientist, and he explains how he has never had a social media account and yet is still able to connect with people worldwide and have a social life. Most people would probably believe he’s insane not to have a social media account considering his profession, but if he still manages to live a normal life, so can you. However, if you would rather not give up social media completely, here are 10 ways to wean yourself off of social media without giving it up completely.


Most people will tell you to stop worrying about things you have no control over. The reality is, everyone does this. It’s part of human nature.

Guess what else you don’t have control over? Worrying! However, what you do have control over is what you worry about, and how often you worry. It’s a good idea to tackle this habit, because excessive worrying can have a negative impact on you as a developer.

Meditation is a practice in which we train our mind and practice turning our attention to a single point of reference. Meditation can help us acknowledge mind content without becoming identified with said content. It’s been proven to reduce stress, which in turn can help you sleep better at night. There are so many different types of meditation:

  1. Transcendental—Known as the state of enlightenment, this means that we experience that inner calmness, that quiet state of least excitation, even while being dramatically busy.
  2. Heart Rhythm—Known as downward meditation, this is a method of breathing that coordinates the body’s respiratory, circulatory, and nervous system in a state of coherence that results in an integration of one’s soul, heart, body, and mind.
  3. Guided Visualization—A newer technique, guided visualization can be used for spiritual healing, stress relief, or personal development.
  4. Qi Gong—This type of meditation improves posture, respiration, and the ability to relax with greater ease. It also involves movement.
  5. Zazen—This literally translates to “seated meditation.” This Zen meditation style relies on self-guidance, and helps you to forget judgmental thoughts, ideas, and images.
  6. Mindfulness—The current favorite, mindfulness, would be a great one for developers. It allows the mind to wander freely, and emphasizes accepting any thoughts that come up.
  7. Kundalini—This is a type of upward meditation that accesses dormant energy to change your state of consciousness.  

Here are more details about these 7 types of meditation (there are other types out there as well; find out what works for you, and build a regular practice).

Replenish your melatonin

Melatonin is a natural chemical in your body that helps you fall asleep. If you are an on-call developer who has to work an off shift, it may be harder for you to rest due to the body losing melatonin during the day (according to research conducted by the University of Maryland). I worked overnight for two years as a computer operator; trying to implement code into systems developed by programmers, and monitor servers and emails to make sure all systems were up and running with no interruptions was a painful experience. Sometimes I even fell asleep on the job.

I recommend a low dosage of over-the-counter melatonin to aid in your sleep. Check with your doctor first before using any over-the-counter products! Using a blindfold can also help if you need to sleep during the day. Blue light from our devices is short-wavelength enriched—meaning a higher concentration of blue light—and affects the sleep-inducing hormone melatonin more than any other wavelength.

Play calm music at bedtime

Lastly, playing calm music at night can help you rest. The reasons why music can help us sleep are still unclear, but may have to do with the relaxing effect certain types of music have on the listener. Or it could be linked to releasing certain chemicals within the brain. For example, you visit a company for a job interview and you enter a small office with magazines and refreshments. In the background, depending on the office, you’ll often hear calm music playing. Naturally, you feel less nervous and less tense before your interview. If music can have that much of an effect when you’re wide awake, imagine the effect it can have when you’re about to rest.

Music can also have the physical effect of lowering one’s heart rate. Personally, I listen to smooth jazz in order to help me fall asleep. Smooth jazz is calm, relaxing, and can be used for more than just a sleep aid—it’s also great for reading and studying. Before I know it, I am sound asleep. At times, I drift in and out of sleep and can hear the music playing. Before I’m fully aware, I’m sound asleep again. Unfortunately, this method may not work every night. Some nights may be so intense that calm music may not help at all. If you’ve had this type of experience before, I recommend you read 10 tips to get great sleep after a stressful day.

If you’re not into smooth jazz, but would like to use music in order to help you sleep, I recommend classical music, or even some country. Both genres of music have many easy-listening tracks that help you sleep. If you’re not into the genres listed above, try R&B, or any other genre that you can feel relaxing and soothing the body and mind. Make sure you keep the volume low to hear more of the melody, rather than the lyrics. It’s a good idea to keep the lyrics soft, because if the lyrics are equal to or louder than the melody, your brain will become curious as to what the song is about, which could disrupt the sleep process.

A good night’s sleep makes all the difference

I urge you as software developers to please make your health a priority. For as long as you live—and I pray that all of you live long, happy lives—you’ll need your body to live in and your mind to live with. Most importantly, you need a healthy mind in order to do your job as a software developer. So why not take care of your health by getting the proper sleep that you need, in order to live an active lifestyle and do your job well?

If we buy a brand new car, we make sure the interior and exterior stay clean. We make sure that the car is well-maintained so it gets us to where we need to go. We should apply this same method to our body, whether our body sends us a signal or not.

Your mind is precious and you’re only given one. Take care of it to the best of your ability.