When I was reading Just for Fun, I came across this paragraph in the book where Linus Torvalds stated that he never missed a good night’s sleep during the early days when he was hacking together the first version of the Linux kernel. In fact, he clearly stated in his book that he doesn’t allow his pet project to come between him and a minimum of eight hours of sleep each night.
Let’s think about this for a moment.
Here’s this guy who wrote an insane amount of complex code without pulling all night death marches. After I read that passage, I couldn’t help but reflect on my own behavior. I’ve been working on countless little pet projects over the past couple of years, often churning out code until 3 or 4 o’clock in the morning during the weekends or holidays. This made me realize that I needed to do something about it. And you know what the stupid part was? I had the right habits all along!
Those who know me know that I start my working days quite early. I usually arrive at the office around 7 o’clock in the morning, getting a fresh and quiet head start of my day. This implies that I go to sleep very early as well on working days, trying to get as much sleep as I possibly can every night.
So, now that I realized that I already had the right behaviors in place, the only thing that I needed to do was to extend this behavior to the weekends and holidays. And I must say that it works great! I instantly stopped hacking on code during the night and now I go to sleep early every day. I also get up early every single day which makes me feel more productive, more efficient and definitely more focused. After doing this for a couple of weeks, I could only come to the conclusion that I felt much better overall.
However, I’m still not entirely there yet. There are some nights that I don’t get to have a full eight hours of sleep, mostly on working days. This is something that I still need to work on, so I create the right habits in order to achieve this goal.
No more sleep deprivation for me. Everyone knows that working more than 8 hours a day is madness. Well, the same goes for writing code after midnight. I came to realize that a good night’s sleep is probably one of the most important tools you have as a developer. A well rested brain is more useful than a tired and a sleepy one.
I encourage you to try this for two weeks and reflect on your mood, productivity and your general well being.
Until next time and good night!