To push your skills as a software developer to the maximum possible levels, the first skill you must master is getting a good night’s sleep. If you fail to master this skill, you will not have access to your brain’s full potential, and will instead suffer from poor memory, focus, and concentration- all of which are critical for writing software.
Maximizing sleep quality involves developing a routine around preparing for sleep. This routine will include the following:
- Buying a quality mattress for your sleeping style
- Buying a quality pillow for your sleeping style
- Buying a quality set of sheets for you bed
- Eliminating caffeine many hours before bedtime
- Eliminating blue light hours before sleep
- Eating a dinner that will not lead to indigestion
- Eating a dinner with complex carbohydrates
- Choose passive entertainment before sleep
- Not over-hydrating before sleep
- Drinking Chamomile tea
- Aromatherapy
- Taking a relaxing shower/bath before bed
- Wear clean, soft, loose fitting bed clothes
- Washing your bedding regularly
- Eliminating sound
- Eliminating light
- Reducing the volume of TV/movies to minimum
- Keeping your phone in “Do not disturb mode”
- Dropping the temperature
- Using a sleep tracker
- If necessary, use an Over The Counter (OTC) sleep aid
- If necessary, seek out a professional therapist
#1 Buying a quality mattress for your sleeping style
Generally people sleep in one of 3 ways:
- On their back
- On their sides
- On their stomachs
Beyond that, people have different body weights and compositions. The combination of these factors will determine which type of mattress is right for you.
Shopping for a mattress could not be more frustrating and inconvenient, so settle in for a process of trial and error, and be prepared to shell out a lot of money is you find the perfect mattress for you. The money will be worth it. As a place to start, you can look at Consumer Reports mattress guide, and that will help you get into the ballpark of what you’re should looking for.
The key element you will be looking for is the shape of your spine while you sleep: it should be in a natural, neutral position, and not curved in unnatural ways as you sleep.
#2 Buying a quality pillow for your sleeping style
If you neck and head are not in a comfortable position while you sleep, you will not sleep well. Just like a mattress, this is trial and error, but experimenting with pillows is far cheaper than experimenting with mattresses.
#3 Buying a quality set of sheets for you bed
Most people find low thread count sheets less comfortable than high thread count sheets. Additionally, most people favor Egyptian cotton as the material of choice. You can go off of how much you like the touch and feel of the sheets rather than the thread count, but err on the high side.
#4 Eliminating caffeine many hours before bedtime
Everyone has different sensitivity levels to caffeine, but generally, you should try to eliminate caffeine as early in the day as is practical. The challenge with caffeine is that it is in many food and drink products where you wouldn’t expect it:
- Many soft drinks have caffeine or other similar stimulant – you have to carefully look through the ingredients to make sure it’s stimulant free
- Tea has less caffeine than coffee, but it still has caffeine. Strongly brewed Black Tea has caffeine comparable to a shot of espresso.
- Pre-workout supplements are often loaded with caffeine
- Chocolate (especially dark chocolate) is loaded with caffeine
- Decaf coffee still has trace amounts of caffeine
Ultimately, if you want a good nights sleep, you won’t get it if you drink a red-bull just before bed.
#5 Eliminating blue light hours before sleep
We now have the ability to eliminate blue light on our devices through device settings as well as f.lux software for desktop/laptop computers, but the default settings often leave in quite a bit of blue light. Speaking for myself, I reduce blue light to the maximum possible, which in comparable to the light emitted by embers. Considering the light from embers is how humans have fallen asleep for hundreds of thousands of years, it seems to me as an appropriate setting.
I actually take this a step further, and use a combination of candle light and red lamps around 2 hours before bed. The impact is pretty dramatic: when I switch the bedroom from warm LEDs at their minimum brightness settings to indirect light from a red lamp, my wife is asleep within a few minutes, where if I don’t switch the source of light she can be up for several more hours.
#6 Eating a dinner that will not lead to indigestion
Our gut can be irritated by a surprising variety of foods, and if our stomachs are irritated we will not sleep well. People are affected differently by the foods they eat, so pay close attention to what you ate before bedtime, and any indigestion you might experience.
#7 Eating a dinner with complex carbohydrates
If you are hungry throughout the night, you will wake up hungry and go hunting for a snack. Complex carbohydrates will keep your blood sugar under control while you sleep so that you stay asleep.
#8 Choose passive entertainment before sleep
If you last activity before bedtime was an adrenaline fueled series of first person shooter matches, your brain will need to calm down before you can go to sleep. Try to replace high-stimulating games with passive entertainment such and books, movies, and TV shows.
#9 Not over-hydrating before sleep
If you drink a bunch of fluids before you go to sleep, you will need to wake up from sleep to pee at some point during the night. You will need to find the right level of hydration of you, so that you don’t interrupt sleep being too thirsty of having to pee.
#10 Drinking Chamomile tea
It is not clear to me what the mechanism in Chamomile tea is that aids with sleep, but I find that it does. It may be a result of trace chemicals in the tea itself, a placebo effect, or perhaps the warmth of the tea itself, or the signal that I’m taking sleep seriously and need to get ready for bed. While I don’t know exactly why it helps, it does seem to help. It certainly doesn’t hurt.
#11 Aromatherapy
…
#12 Taking a relaxing shower/bath before bed
A shower can be seen as either as a:
- Utilitarian activity best gotten over with as quickly as possible
- A relaxing activity to be extended until the desired level of relaxation is reached
I take full advantage of the relaxing effects of hot water and steam, whereby a 30 minute shower (after a challenging day) is fairly typical.
#13 Wear clean, soft, loose fitting bed clothes
Clothes that are too rough, too tight, or dirty will affect your comfort while you sleep. If you are uncomfortable, you will not sleep as well.
#14 Washing your bedding regularly
You will sleep better on clean sheets than on dirty sheets. Generally, you should wash your sheets once a week.
#15 Eliminating sound
It is easy to forget what “quiet” actually is, but you need it to be as quiet as possible to have the highest quality sleep. Get a decibel meter all, and made sure the average sound in your bedroom does not exceed 40 decibels.
#16 Eliminating light
Eliminating blue light before you sleep is important, but having no light while you sleep is also important. With the lights off, you should be able to hold your hand in front of your face, and not be able to see it. To achieve this, you will most likely need heavy curtains, and place tape over any LEDs for devices that have them constantly on.
#17 Reducing the volume of TV/movies to minimum
Removing as much blue light as possible in your passive entertainment won’t do much if sound is blaring in your ears. Reduce the volume to the lowest level you’re willing to tolerate.
#18 Keeping your phone in “Do not disturb mode”
Missing out on text messages, social updates, and email while you sleep is not only perfectly OK, it’s highly desirable. Don’t let FOMO steal your slumber.
#19 Dropping the temperature
The air temperature in your bedroom needs to be around 65-67 degrees. This isn’t to say you should be shivering as you sleep, but it’s important for you to be cool, as being hot will interfere with your sleep. Also pay attention to humidity, as humidity combines with temperature to give you a sense of being too hot or too cold.
#20 Using a sleep tracker
Using a device that tracks how you sleep can be invaluable in optimizing your sleep. By tracking how you sleep, you can tweak and optimize everything about your routine. This helps you find the right combination to maximize your sleep quality.
#21 If necessary, use an Over The Counter (OTC) sleep aid
Non habit forming over-the-counter sleep aids exist; but if you use them, follow the recommended use. I would advise trying all of the approaches above before you resort to chemical assistance.
#22 If necessary, seek out a professional therapist
If you’ve tried everything above and still cannot get a good night’s sleep, it’s a good idea to seek out a psychologist to figure out if there are underlying anxiety, depression, or other issues that may be preventing you from getting a good nights sleep. Depending on your situation, your psychologist may refer you to a psychiatrist for prescription sleep aids, or other medications to address whatever other issues that are keeping you up and night. It has been my experience that mental health issues are common among software developers, but seeking treatment is not something often discussed. Just know this: there is no shame in seeking help, and the results of proper treatment can be miraculous.