Live data from Hacker News

Ask HN: Do you struggle to sleep after coding all day?

news.ycombinator.com

21–30 of 77 posts

Re: Ask HN: Do you struggle to sleep after coding all day?

#21

I had the same problem. Using f.lux[0] and writing down all the problems (programming related or not) that occupy my thoughts on a notepad which lives next to my bed, just before going to sleep totally eliminated the issue. [0]: https://justgetflux.com/

Make sure that you install it on all your devices. I used to read late night on my iPad, and it helped me a lot.

Re: Ask HN: Do you struggle to sleep after coding all day?

#24
I've tried melatonin, cutting out alcohol, f.lux, not looking at a screen for an hour before bed, but the one thing that has had the most influence on my sleep (for the better) is cutting out caffeine after 4pm. (relevant study: http://www.aasmnet.org/jcsm/ViewAbstract.aspx?pid=29198)

Re: Ask HN: Do you struggle to sleep after coding all day?

#25

Last night for me was particularly tough. Coded essentially all day, struggled with a bug for hours, and was still on a caffeine high past midnight. The game plan for me should just be to wake up even earlier and wear myself out through more exercise.

Caffeine destroys my sleep. It didn't use to, but since I dialed down my caffeine intake, I'm more sensitive to it. If I forget and have a coffee after dinner, I'm done for and won't fall asleep before 2AM-3AM.

At least I know the pattern. A problem without solution is already solved: I just pick up a good book and wait it out, knowing I'll be sleepy the next day.

Re: Ask HN: Do you struggle to sleep after coding all day?

#26

When I find my mind won't settle down, I'll do 1 of 2 things. If I'm concerned about a list of actions I need to do the next day, I'll write down the list on paper. This allows me to relax and know I won't forget anything. Otherwise, I'll write in my journal about what ever my thoughts are. This allows me to slow my brain down the my writing speed. It lets me process my thoughts. Its helped immensely.

As well as the list approach, actually say loud to yourself "I will solve thhe unfinished problems tomorrow, tonight I will relax". Give yourself permission to relax!

Re: Ask HN: Do you struggle to sleep after coding all day?

#28
I find that if I'm having trouble sleeping because my mind is jumping all over the place, intentionally taking time aside before sleeping to clear my head helps a lot. I just sit on the floor, examine my current thoughts, thing about them a little and write down important ones for a few minutes, then decide to stop. At this point I just practice clearing my mind for a few minutes. Thought popped back into your head? That's fine, realize it happened, and try again. Meditation, mindfulness, whatever you call it - works well for me!

Re: Ask HN: Do you struggle to sleep after coding all day?

#29
A fellow coder friend of mine leaves smartphone and all electronic devices outside the bedroom door before sleep. Also, spend 1 hour before bed doing something like reading or chores like cutting up onions might help as well. Just imagine onions are more important than those bugs at that moment helps.

Re: Ask HN: Do you struggle to sleep after coding all day?

#30

I had the same problem. Using f.lux[0] and writing down all the problems (programming related or not) that occupy my thoughts on a notepad which lives next to my bed, just before going to sleep totally eliminated the issue. [0]: https://justgetflux.com/

I recommend Redshift instead, which is a free software alternative: https://github.com/jonls/redshift
Post reply on HN