3 ms·
I often spend 12-16 hours a day writing code (or, depending on where I'm at, putting pen to paper while I convince myself that the way I've found for solving a
by cperciva 19y ago
I often spend 12-16 hours a day writing code (or, depending on where I'm at, putting pen to paper while I convince myself that the way I've found for solving a particular problem will work), but I don't rob myself of my 8 hours of sleep.
I've found from experience -- both while writing code and during my doctorate -- that the quality of work I produce when I'm sleep-deprived drops dramatically. If I'm lucky, I look at my work the next morning, decide that it's garbage, and throw it out; if I'm unlucky, I end up throwing out said sleep-deprived work a few days later, after spending many hours tracking down heisenbugs.
YMMV, of course -- some code is sufficiently straightforward that you can write it in your sleep, or (even better) has sufficiently explosive failure modes that you can test it in the morning and (assuming it doesn't explode) know that despite your lack of sleep, the code is good. And, of course, just as some people can code perfectly well while drunk or high on drugs, some people are entirely unaffected by not getting enough sleep.
But as for me and the code I write? I'll stay away from the drugs and make sure I get enough sleep, thanks.