DEV Community

Cover image for Want to be a better developer? Take care of your sleep!

Want to be a better developer? Take care of your sleep!

Damien Cosset on July 04, 2019

Introduction The world of today is all about productivity and speed. Everything has to be done quickly, and because there are only so mu...
Collapse
 
spqrbob profile image
Bob McCann • Edited

Damien,

Your article resonated with me and my struggles with sleep. I struggle daily with physical fatigue, poor mental focus and concentration, and difficulties with memory. My sleep hygiene is terrible. I stay up far too late, and then when I do come to bed, the first thing I do when I get under the covers is grab my cell phone and browse Reddit for 30 to 60 minutes. I have a CPAP machine, but I only use it about half the time, and my wife usually is watching TV when I am trying to go to sleep. It is a wonder if I get any sleep at all.

At work, I am tired, and my thoughts are scattered. I have trouble staying focused on a task until it is completed, and at the end of the day, I am often left wondering what exactly did I accomplish today? I also go the school part-time with classes in the morning. By the time I leave work, stop by the store, finally get home and have dinner, I am so exhausted that any homework I have been assigned seems like too much to deal with. My grades have suffered.

I have thought all of this was signs of getting older, and perhaps the result of some medical issue causing my chronic fatigue. We have done sleep studies and I have tried medications, I have the aforementioned CPAP machine, and none of it helps me. On the positive side, I quit drinking carbonated beverages several months ago, and the only caffeine I normally take is in the form of pills, which I take in the mornings and early afternoon. What I haven't done yet is all of the other things you talk about in your essay.

I am going to try to do what you have suggested in this article for the next 30 days: I will endeavor to get to bed earlier and rise earlier as well. I am not going to ask my wife to not watch TV at night, but I do have earplugs and a sleep mask to keep out the noise and light. The only thing I will use my cellphone for in bed will be to make sure my alarm is set for the proper time for the following morning. I will be loyal to my CPAP, and use it faithfully every night. I will endeavor to use my newfound energy in the morning hours to begin a program of light exercise, such as walking with my wife. I might even start a more strenuous exercise routine later in the day in the gym at my workplace. I may or may not be able to go forward with the magnesium cream and houseplants at the outset, but may be able to later.

Let's see how my 30-day experiment goes! Perhaps I will make a profound discovery that will allow me to regenerate myself and find a well of energy, focus, and concentration that I never thought possible anymore. Maybe I'll just get some good sleep. Whatever the outcome, I know what you suggest is far healthier than my current sleep behavior. Wish me luck!

Collapse
 
smartcodinghub profile image
Oscar

Don't forget to do an update with your results and thought. I have the same problem. Good luck!

Collapse
 
damcosset profile image
Damien Cosset

Good luck my friend 💪

Collapse
 
murkrage profile image
Mike Ekkel

A great read! I'll be the first to admit my sleeping schedule is all kinds of messed up. I'm trying to get back into a proper rhythm but it's incredibly hard. I have a hard time getting to feel sleepy, if that makes sense? If I go to bed without feeling sleepy, even if I don't turn on any screens, I'll stay awake for a good 2 hours. I just won't fall asleep. It's tough and I often find myself opening Twitter or something like that to keep me occupied. I'll eventually fall asleep, though. I guess the first thing I can do is make my bedroom a no-screen zone, that'll probably help me out a lot.

Collapse
 
damcosset profile image
Damien Cosset

Your sleep cycle was most certainly affected by the screens ;)

The no-screen zone is a must in my opinion ( and gosh it's hard... ). I would also suggest, if possible, to spend some time outside before 8:30 AM. Bright lights exposure help the release of melatonin in the evenings. That could help you fell sleepy ;)

Best of luck!

Collapse
 
murkrage profile image
Mike Ekkel

AM or PM? Because I am definitely outside before 8:30 AM :). Starting Monday I'm also going to get into some form of exercise schedule. Back when I still did some sort of sport on a regular basis, I noticed I slept like a baby. So I am definitely taking that advice with me! Going out at night, while it's still light out, will probably help my mental state as well. Plus, it gives me a chance to just stroll around the city with my partner every day :)

Thanks for this post, it was a great read and really motivates me to get into a better sleeping rhythm!

Thread Thread
 
damcosset profile image
Damien Cosset

That's AM ;)

Exercising, exposure to light during the mornings, that will definitely help you a lot!

Thread Thread
 
murkrage profile image
Mike Ekkel

I will keep that in mind :)

Collapse
 
karlredman profile image
Karl N. Redman

Please add tag #mentalhealth

good stuffs.

Some of this is not exact science (i.e. scientists just revealed XXX about coffee blah, blah [specifically, coffee drinkers live longer -but that just might be the daily wine I'm drinking doing the talking :P].

I think what you're preaching is balance (IMHO). And that's fantastic relative to the info you present here.

Collapse
 
damcosset profile image
Damien Cosset

Thank you.

About coffee, just avoiding it close to bedtime is enough ( I believe it lasts 8 hours in your system or something like that ). I'm personally not going to give my daily cups of coffee :D I'm just making sure to not drink any after 4PM ;)

And I agree about the balance. I can understand that sleep is sacrificed at some point. We all have busy lives, with a lot of people counting on us. Cutting down on sleep is the easiest thing to do. I have been doing it, and will most likely do it again at some point in the future unfortunately. As long as it's a short-term thing.

What really pisses me off though is people preaching that you NEED a 4-5 hours sleep per night if you want to make it. That kind of war on sleep makes me sick.

Collapse
 
karlredman profile image
Karl N. Redman

heh, about coffee (further).... it's something people add to their systems. Everything we add into our bodies is part of the overall "chemical game" that we play overall -sugar, meat, etc. And this all affects everything we do -not just sleep.

I joked around with my comment relative to science but the one thing that is consistently reported for health/mental-health is the need for sleep and a sleep regiment. I'm terrible at this also; regardless of my daily routine.

Likewise, but maybe that's just bravado(?). I feel that I work best working 10 hour stints over a 30 hour period and sleeping 12 hours after that (with cat naps in between). Obviously I can't sustain that and also do a 9-5. And in that respect I think the make it perspective comes from the context of 'how to make it to daily corporate meetings and such (broadly speaking). That need aspect is foreign to me (with my 'i'll sleep when i'm dead' attitude). But maybe we're the fools(?).

Another thing:
I've experienced a fair amount of PTSD things that cause sleep issues. [I'm using myself as an example here]. I think make it is relative to what your mind has tolerance for in terms of downtime. In my situation, I think(?) my mind/muscle-memory/etc. only allows for 4-5 hours of sleep at a time; which makes things tricky for jobs and stuff.

Like I said: I like your article. It's a subject that is dear to me and I think it's really an important topic -and often a neglected subject matter.

Lastly, I apologize for not adding sources for my comments. I can do so if pressed.

Cheers!

Thread Thread
 
damcosset profile image
Damien Cosset

That need aspect is foreign to me (with my 'i'll sleep when i'm dead' attitude). But maybe we're the fools(?).

I sure hope not :D

I completely understand, and agree, that every one is going to have different circumstances and preferences on how they approach their relationship to sleep. The 8 hours sleep might be a luxury that only some can have. I don't have kids yet, so maybe I will change my speech later :D

As for the sources, if you feel like they could contribute to the article, I would be more than happy to add them in the sources for this article. Having another point of view and a different pair of eyes on the subject can't hurt.

Collapse
 
vimmer9 profile image
Damir Franusic

First or all, It's a great article and I haven't finished it but have, on the others hand, saved it for later. The funny thing is, when you're younger you feel invincible and don't pay attention to your sleeping habits.

I belive this is especially prominent in software development community or maybe it's IT in general. I felt the need to comment since I've been doing dev for around 20 years, started when I was 16.

In the old days, I would sleep maybe 2 to 4 hours a day, and would stress myself to the point of almost collapsing.

After weeks of this torture, my body finally decided to put a stop to all this in a form of grand mall epileptic seizure. And there you have it.

If I hadn't been so reckless about my own health, my daily routine would not include taking two types of pills twice a day.

This is just my unfortunate experience and it doesn't happen to everyone but it could happen to you if you're not careful. Times have also changed, for the worse of course; now it's even more stressful and people are pushed to work even harder.

Go to bed before 2am, get at least 6 hours of sleep, it will increase your productivity and maybe spare you of any potential health issues.

Cheers,
DF

Collapse
 
jnasoy profile image
Joseph Nash Belandres

Great article. I usually only get an average of 5 hours of sleep and I don't feel productive even though i have more available time (technically) to do work. I feel like I am always dreaming up to the point i cannot recognize reality anymore (you know what i mean? Hehe). Thanks for the advice i will try to get as much sleep as I can starting today. It all boils down having self dicipline

Collapse
 
garrett profile image
Garrett / G66

I definitely sleep more than I should, but I think some of that is because my sleep isn’t optimized.

I especially need to work on the dark room. I live in an apartment and there’s a light right outside my bedroom window. I didn’t know that the light affected us through our skin. I got a sleep mask because I thought it only affected us through our eyes. I’ll need to get blackout curtains.

Collapse
 
tdfranklinaz profile image
Trevor Franklin

I've had a huge issue with sleep when I first started working at a digital agency. I got into a bad loop where I was only getting 4 hours every night for months at a time and it was effecting my performance on the job.

My solution worked really well: Turn off all electronics after 10:00 PM and initiate my nightly routine. Shower, writing in my journal to reflect and get all my thoughts out before getting into bed and reading until I pass out. My sleep just about doubled and I started waking up feeling amazing!

Before I started using this routine I was waking up feeling like crap and I had already failed my day before it started. I would encourage everyone to get enough sleep and wake up as early as possible.

"early to bed & early to rise makes a man wealthy and wise"

Collapse
 
omerxx profile image
Omer Hamerman

Fantastic piece. Sleep is important to everyone not only developers.
Sleeping enough is ground for clear mind which is able to think process and create. When we’re creative we’re also productive and more importantly HAPPY.

Collapse
 
petarov profile image
Petar G. Petrov • Edited

We were hunter-gatherers, programmed to go to sleep at sundown because waking up at noon was not a great plan for surviving predators. For thousands of years, we have lived this way. We haven't had time to override the default settings of our species concerning our sleep.

Perhaps something interesting about this is that being active only during the day and having an 8 hour sleep in the night seems to be more of an industrial age thing, rather than the way we've been living for thousands of years.

Some studies and old literature suggest that people before the industrial age practiced something called the interrupted sleep which consisted of 1st and 2nd sleep. The pause in between was used for people to pray, socialize, even visit neighbours and so on. More about this in The myth of the eight-hour sleep

Other than that, I completely agree with you that blue light is an enemy of good sleep and going to bed at around 10 PM definitely makes a difference!

Collapse
 
damcosset profile image
Damien Cosset

Interesting read. It would seem that we started playing with our sleep cycles earlier than I thought.

Collapse
 
veebuv profile image
Vaibhav Namburi

The toughest truths I need to accept. I'm horrible with my sleep and I know it affects my concentration immensely. I NEED to fix this habit and couple it with exercise!

Great read mate! Very important topic

Collapse
 
shreyasht profile image
Shreyash

One of the best article I have read on Dev!

Whatever you do, if you are not well rested, your performance would be sub-optimal.

Some more factors that affect performance are:
1) Diet: Eating too much sugar or carbs around bedtime causes issues with sleep. Also, in general, if you are not watching what you eat then you are not doing justice to your body.
2) Stress: There is no other worst enemy than stress. If you are stressed out, your hormones would go haywire.
3) Not taking a break from the routine: A monotonous routine is something that really breaks you.

Collapse
 
damcosset profile image
Damien Cosset

Amen to that!

Collapse
 
kienngo profile image
ken

Agree with the Mother-in-law tongue. In my country they're called "Tiger's tongue" or "Snake's skin" :)

Collapse
 
inigogb profile image
BaronVonHex

Thx bro, I've been neglecting my sleep lately due to heavy workload. Going straight to bed before damaging my health. Time to count some electrical sheep.

Collapse
 
mihirpa98294668 profile image
mihir patel • Edited

Nice to be visiting your blog again, it has been months for me. Well this article that i've been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share.kodlogs.net/562/how-to-get-quality...

Collapse
 
damcosset profile image
Damien Cosset

We've all been there 😉.

Collapse
 
iami1ee7 profile image
lami

in my country they said want to be developer need no sleep. for me I don't know why I can become a developer when I'm always sleep at night hahah