It's hard to think about a million different problems a day and how to solve them then just cut all that off at 10-11 or so each night.
It probably doesn't help that coding is my hobby as well as my profession, so it really doesn't ever get turned off.
- f.lux (time of day dependent display colour temperature)
- physical exercise
If I drop either for more than a few days, I'm back in insomnia land. If I exercised every single day, I'm sure I wouldn't need f.lux. Unfortunately, exercise takes quite a bit of willpower in winter (no nearby gyms).
Has anyone done this study? It seems like a pretty straightforward study to do if some grad student out there is looking for a paper.
To shut down the problem-solving machinery I usually fantasize about being starting point guard for the Lakers. May sound silly for a grown man, but it works for me.
Concerning your point, from your comment it seems like you are still young. At some point, you'll have to find a more sustainable pace. Most engineers I know have a family to support, like to do their job well, and thus need to have an overall good life hygiene.
I have found I can "cut off" the deep thoughts by writing them down. I keep a notebook next to my bed and if I can't fall asleep because of something I want to program, I will write out everything about it in the notebook. After that, I'm far more relaxed because I am not worried about losing the knowledge once I fall asleep.