How one habit made me a better programmer overnight?

What if you have a habit that can change your life?

How one habit made me a better programmer overnight?

Since ages, I struggled to consistently sleep well. Although I go to bed relatively early, I usually fall asleep hours later, sometimes near midnight. All this time, even though I am tired, my brain is completely alert. Next morning, I wake up later, feeling sleepy throughout the day. Then at night unless I am exhausted, I again take time to find my sleep as I woke up too late that day. This unfortunately becomes a vicious cycle.

I am by nature an Early Bird, which means, it's best for me to sleep early and wake up early.

To address this issue, I try exercise at least thrice per week. I maintain going to bed early and avoid drinking coffee around seven hours before my sleep time. In addition, I've also consume teas that help sleep, which I observe is a hit or miss situation (mostly miss).

Subsequently, a few weeks back, during my usual Pomodoro break, I stumbled upon this tweet.

As I am rereading the bestselling book Atomic Habits by James Clear, my immediate response is to make this timing into a habit. No more unhappiness and a lack of productivity (and headaches) because of sleep deprivation.

I add a new habit in my Habit Tracker App, reminding me to stop using my phone 90 minutes before my sleep time. By doing that, I have direct feedback on a daily basis on the habit, helping me track and stay motivated on my goal.

Habit Tracker


As a fitness enthusiast and in my quest for delivery quality work as a programmer, I prefer getting plenty of quality sleep every night rather than wasting precious time on social media, playing games or watching television.

Lately, I've even stopped watching my favourite football team, Manchester United play if the match time coincides with my sleep time.

The Habit

The idea itself is simple yet radically effective. I've yet to miss a single night of good sleep when following it. One and a half hour before my sleep time, I stop using my mobile phone. I sometimes turn off the wifi and put it somewhere I don't see it. When I succeed, the next day, I tick the habit on my habit tracker app.

A habit is something you do without thinking or something you do everyday. If you want to be successful, you need to be consistent, that is do it every day until you no longer have to think about it. The new habit becomes automatic.

Yet most people prefer playing games, indulge in pointless talks and devour mindless social media until late at night instead of having a good night of sleep.

Better Programmer

Consistent quality and quantity sleep enables me to write effective codes that are easy to change and debug. I feel calmer particularly when working with a complex task having a short deadline. The best benefit nevertheless for me, is enjoying my craft and my day at work without eyes and head aches.

Resounding with my personal experience, sleep is critical for decision making as plenty of researches suggest. Programming, more than anything else, is about effective problem solving.


All coding and no sleep makes Jack/Jill a dull developer, research confirms