Over the years, I've heard many developers brag about their lack of sleep and all night coding sessions. If I could give you any advice on how to be a better coder, healthier, and just plain feel better, I would tell you to get better sleep.
You may not want to read this article if you aren't serious about getting more sleep because it will almost scare you into sleeping more. I have been sleeping more the last couple years and it's helped my body and mind tremendously. Sure, there are still times you need to stay up (my daughter and I are planning an all-night "Stranger Things" watch party at the end of the month), but make that the exception rather than the rule.
The shorter your sleep, the shorter your life: the new sleep science by Rachel Cooke