DEV Community

Cover image for Stop thinking about your work at night
Abhinav Pandey
Abhinav Pandey

Posted on • Updated on

Stop thinking about your work at night

A week ago I saw a discussion where people talked about how they stay awake thinking about their code and how they dream about it sometimes.

Wondering why this happens and how to stop it, I tried to understand the psychology behind it by revisiting my own experiences with burnouts and mental health.

Checkout this thread to know more about the reasons you could be going through this and how to overcome this.

If you have your own experiences to share, please make sure you add them in the comments below. If remote work is making things harder for you, check out my other article on WFH best practices


If you like this thread, Connect with me on Twitter for a one stop destination for all my threads and blogs.

Connect with other members of the tech twitter community to increase your growth manifolds.

Top comments (18)

Collapse
 
andreidascalu profile image
Andrei Dascalu

I try not to think much about work after hours. But the thing is, the brain will work on challenges on its own.
It's not just about work but programming, by nature, it's mostly an intellectual challenge.
Sometimes my brain thinks about various mental challenges I fail at, whether it's a chess game, a bug, a task or a puzzle.

Collapse
 
094459 profile image
Ricardo Sueiras

This is a double edged sword for me. Like others in the thread, getting work out if your head can be hard and lead to restless sleep, but Iโ€™ve also personally had many hard problems solved. At the moment Iโ€™m comfortable with this, and by the look of my Fitbit sleep data, Iโ€™m getting good sleep so Iโ€™ve not really thought about coping strategies yet

Collapse
 
heatherw profile image
Heather Williams

I find that if I start to worry about things like what I am thinking about at night then that worry is what keeps me awake (over analysing my thoughts). But if I just let the thoughts come and go on whatever topic my brain is gnawing on then it is better for sleep.
So I would say: stop worrying about what you are thinking about and just let your brain be rather than anything else.

This does come with a caveat: if your work is constantly keeping you up at night and you are stressed out about it then you need to figure out what is really happening and how to resolve the underlying issue.

Collapse
 
abh1navv profile image
Abhinav Pandey

Yeah. Important to shut the brain down for 2-3 hours before sleep. One of the people here mentioned chess. When I play chess in my liesure time, I keep thinking about how the moves when I try to sleep.

Also important to avoid phone time close to bed time.

Collapse
 
stackundertow profile image
StackUndertow

Actual science doesn't support this, it's just a compartmentalisation issue on your part. You should only use your bed for sleep; this conditions your brain to seek sleep when you're in said location ( this is basic training in most militaries for a reason ). A schedule is important as well for the same reasons; the problem isn't what you're doing, it's where you're doing it. Your mind is perfectly capable of working right up to the time you enter your sleep cycle.

It has been well-documented* that not being able to shut your mind off and obtain quality sleep when you need it is ultimately a mental discipline/sleep hygeine problem. Outside of your having OCD or an undiagnosed stress disorder or an obesity problem that induces pain, you don't have to waste the last 3 hours of the night "sleep prepping." If you have any of those problems, that's an edge case.

Collapse
 
jlopez788 profile image
Juan Lopez

I normally don't think about work after hours, the only time I can't is when I have a bug that I can't seem to troubleshoot and the time is up for the day. It bothers me to no end when I can't find where the bug is coming from. Once I figure it out work is out of my mind.

The hardest bugs to troubleshoot are memory related issues (null references, memory leaks, references are lost and you wonder where this other reference came from..)

Collapse
 
abh1navv profile image
Abhinav Pandey

I relate strongly to this.
I don't normally think about that bug once I close my laptop but it can very easily make me stetch my working hours.

Collapse
 
massic80 profile image
Massimiliano Caniparoli

I never have problems sleeping, when I allow myself to go.
If I have a problem whom my brain keeps thinking about, I just go on working, until I definitely collapse.

My real problem is not at night, but instead during the days when I should be thinking about everything else!

Collapse
 
siddharthshyniben profile image
Siddharth

(Un)Fortunately I code for a hobby.

Collapse
 
abh1navv profile image
Abhinav Pandey

That's a great hobby.

If you dont code 8 hours a day in the corporate world, it doesn't apply to you yet.

Anyways, coding is a viable hobby. For most developers, that second engaging task will be their side projects. Nothing wrong with it.

The focus in that case needs to be on setting achievable targets each day and feeling happy once you achieve it.

Collapse
 
siddharthshyniben profile image
Siddharth

Right now, I just code for around 1-2 hours every day. I've yet to code for a job. It will be a long time till I do so (I'm just 13!).

Collapse
 
torrentcome profile image
ectorrmonte

It's awful because you can't stop to think about it.

The only people who don't think about their code during night have stopped to be developer :D

Collapse
 
siddharthshyniben profile image
Siddharth

We never sleep

Collapse
 
abh1navv profile image
Abhinav Pandey

We have the most addictive job for sure. ๐Ÿ˜‚

Collapse
 
l0wk3y profile image
L0WK3Y | I.A.A.N

I've experienced this many times in every aspect of life including coding. I think it's just a natural process of how your brain resolves problems. ๐Ÿค”

Collapse
 
c0mtruise profile image
Prakhar Shukla

Not possible. I work 24x7 and coding is actually my hobby.

Collapse
 
abh1navv profile image
Abhinav Pandey

Coding is a fine hobby.

How do you work 24x7?