Live data from Hacker News

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

news.ycombinator.com

1–10 of 77 posts

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

#2
Sounds normal - your mind is still working on the problem.

I've been taking a melatonin supplement lately - it's helped. Cut back on your coffee intake if you drink coffee and try to work out for 10-20 minutes, even if it's just going for a walk or a light bike ride.

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

#3
I have a somewhat reverse problem. Some days I struggle to through the day coding, even on routine or easier coding tasks. When this happens find myself daydreaming or finding other things to do that are not work related. The real problem comes though at about 10-11pm and I get a huge burst of energy and focus to start working. I am left with a choice to stay up later and get work done, or go to bed and wake up earlier to catch up on work I missed. If I do decide to go to bed I will lay there for an hour or so just thinking about work and what I need to get done.

With that said, last year I was talking to my doctor about it at my annual physical. He suggested I exercise more often. So for about the last 6-7 months I have made a conscious effort that whenever I feel like I am starting to struggle I will go out for at least a 30 minute walk. I usually end up taking about 4-5 a day. There is definitely a direct correlation between the amount I walk and my productivity. And I am starting to sleep a whole lot better at night. Another thing that has helped me is I stopped drinking soda and now only drink water (or coffee).

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

#5
Yes! Not just coding, but I have been struggling to turn my mind off from work to sleep. I think about the new feature I'm coding, about new ideas on how to reach out to more users, etc... I really felt it started to become a serious problem in the last months, so I then cut my evening coffee (only have it in the morning now) and started to swim/gym around 6pm.. But the main thing is not to use your laptop as the last thing you do before sleeping... Even if you're working late, get rid of it and do something else for 40 minutes before trying to sleep.
Post reply on HN