Ask HN: Do you struggle to sleep after coding all day?
41–50 of 77 posts
Re: Ask HN: Do you struggle to sleep after coding all day?
#42Re: Ask HN: Do you struggle to sleep after coding all day?
#43When my mind jumps around I try to do focus on a single boring task, like trying to enumerate all 50 states or think of a fruit and vegetable for every letter of the alphabet.
Re: Ask HN: Do you struggle to sleep after coding all day?
#44I'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 )
All of the above + regular exercise.
Re: Ask HN: Do you struggle to sleep after coding all day?
#45Look up the "body scan" method (it involves resting your attention on & relaxing each individual group of muscles in your body). Puts me to sleep without fail.
Re: Ask HN: Do you struggle to sleep after coding all day?
#46Sleeping takes practice like any other skill. If your bedtime is erratic, if your sleep pattern is erratic, if your environment is erratic, your brain isn't sure when it's time to go to bed. Pick a time for a week and go to bed then regardless of anything else. Try to limit light exposure for the hour before sleeping (no phones in bed) and see if that helps. The more consistent you can be, the more consistent your sl…
I hate the "no phones in bed" rule, and literally everything I do is PC-based or phone-based, so I stare at one screen or another right until I sleep. The f.lux and Twilight (Android) apps have been very helpful at making me feel more naturally tired when I should be. Additionally, the Sleep as Android app makes for a great way to track and log sleeping patterns, and has a nice adaptive alarm.
Re: Ask HN: Do you struggle to sleep after coding all day?
#47Re: Ask HN: Do you struggle to sleep after coding all day?
#48Nowadays I've taken to creating a to-do list before setting out to code and I always make sure to add a couple of tasks that are somewhat simple and I'm sure I can usually complete before bedtime. That way, even when I haven't run through the entire list, I feel like I've gotten something done and the day has not been completely useless. It usually takes some of the edge off any worries I have.
Re: Ask HN: Do you struggle to sleep after coding all day?
#49Re: Ask HN: Do you struggle to sleep after coding all day?
#50Are you working, or staring at a bright screen, right up to bedtime? That seems to make sleep harder for me. A few things I've found that help me: - Exercise. I work out 8-12 hours/week. Being physically tired makes sleep easier. - Eat dinner >2 hours before bed and avoid late snacks. - No alcohol (I do have an occasional drink, but it always impacts my sleep) - No TV in bedroom. I either read for 30-60 minutes or ta…
When do you exercise though? I find exercise before bed makes it easier for me to sleep but others I've spoken to seem to get too pumped up!