DEV Community

Prahlad Yeri
Prahlad Yeri

Posted on

Having a good night's sleep is very important for programmers

The biggest problem with programmers is that they become so involved in programming that sometimes they lose track of reality. I've seen coders forgetting as basic things in life as drinking a glass of water or having food when they are hungry.

Getting into the zone is a very good thing, even prioritizing it against other tasks is sometimes essential, I get it. But you need to realize that some things are essential for your long term health and well being and those can't be ignored even for programming.

There is also an increasing number of coders who stretch it into late nights. Nature has a certain pattern of sleep and wakefulness, if you disturb that pattern with irregularity, the consequences could be far worse for your long term health and well being. Take a pause and try to understand for a moment: what is your goal in life with coding? You code in order to finish your project, which in turn earns you money for enjoying happiness in life.

So, what benefit do you get by working through late hours on coding when that very happiness and well being is being sacrificed? Think and meditate on it.

Top comments (5)

Collapse
 
anduser96 profile image
Andrei Gatej

Thanks for bringing out this topic!

I’m in the habit of spending my nights coding and even though I’m conscious of what the effects may be in the long term, right now my focus is on mental happiness. I feel great when I finally understood something that seemed very difficult at the beginning.

Despite the fact of being happy mentally, I can tell that my body is suffering. I can’t hear the alarm in the morning(or in any other part of the day, I can’t simply hear it and wake up).

I’m plan on fixing this schedule. I also feel different about myself(in a good way) when I start the day at 8am instead of 11am.

This post was like a reminder to me. I have to make a small change. Thanks a lot!

Collapse
 
joeattardi profile image
Joe Attardi

Sleep is important! That said, I do a lot of coding late at night anyway. This is mostly because I have a five month old at home who takes up all of my extra time while he's awake. Then I'm cleaning up, making bottles, etc. Finally around 10 or 11, everyone's in bed and I have some time to myself, so I go and code.

I know I shouldn't keep doing that indefinitely, though, or it might catch up with me in a bad way.

Collapse
 
rgeraldporter profile image
Rob Porter

Getting good sleep has helped immensely in programming.

Recently I read the book "Why We Sleep" and I'd recommend it to anyone.

I actually listened to the audio version, and the narrator actually is very calming to listen to, making it oddly a good book to fall asleep to!

The other reason I'd recommend it: you'd feel negligent NOT getting sleep after reading it. If you need a book to scare you into getting a good night's sleep, that one is it!

Collapse
 
joppedc profile image
JoppeDC

But what if -> coding through the late hours is the exact thing that brings happiness?

Collapse
 
owsilva profile image
Walace Silva

Hey man! This topic is very good, I've been thinking in as a night bad sleeped could to be bad for health.