Embark on my indie hacking journey: Documenting each step, sharing insights along the way

Home » Blog » How to Make Programming a Daily Habit

How to Make Programming a Daily Habit

Coding is the topic of these past years. A lot of people want to start programming and become a developer. How can you develop a coding habit?

A few days ago, I started to read “The Power Of Habit” by Charles Duhigg. This book makes me think a lot about why people are struggling at daily programming. I think it’s because of the habit process. Most people don’t know how it is working and need concrete examples.

In this article, I’m going to explain to you what a habit is and give you some advice to help you create a daily programming habit.

What is a habit

Before starting, it’s essential to define what is it and what are the components of this process.

If we check the definition of the word “habit” on Google, we find this:

are routines of behavior that are repeated regularly and tend to occur subconsciously


a behavior pattern acquired by frequent repetition or physiologic exposure that shows itself in regularity or increased facility of performance

Meriam-Webster Dictionary

a recurrent, often unconscious pattern of behavior that is acquired through frequent repetition

The Free Dictionary

something that you do often or regularly, often without thinking about it

MacMillan Dictionary

As you will have understood, a habit is an automatic process in your life. Take brushing your teeth, for example.

It’s interesting to define the components of a habit to understand how it is working.

Each habit includes three components: a cue, a routine, and a reward.

The Habit Loop by Charles Duhigg

What is the cue

The cue is the event in your life that make you trigger a habit. Every time you make something automatically, it has been started after a signal.

Most of the time, a cue is defined by time, an emotional state, a location, or an action.

For example, I’m working when suddenly I smell the coffee from my colleague. My habit “Taking a coffee” is triggered.

What is the routine

The routine is what you are doing while the habit process is running. You can define all that you want in this part. As I said previously, it can be: I’m going to take a coffee.

What is the reward

The reward is the final element of the process. That’s kind of what this routine has done for you. For the coffee example, the reward can be: Thanks to the caffeine, I feel less tired, and I am more dynamic.

The more the reward is positive and pleasant for yourself, the more your brain will save the habit.

This process within our brains is a three-step loop. First, there is a cue, a trigger that tells your brain to go into automatic mode and which habit to use. Then there is the routine, which can be physical or mental or emotional. Finally, there is a reward, which helps your brain figure out if this particular loop is worth remembering for the future. Over time, this loop—cue, routine, reward; cue, routine, reward—becomes more and more automatic. The cue and reward become intertwined until a powerful sense of anticipation and craving emerges. Eventually, whether in a chilly MIT laboratory or your driveway, a habit is born.

Charles Duhigg, The Power of Habit: Why We Do What We Do in Life and Business

A little exercise

I give you a little exercise to do, take one of your daily habits and try to define the cue, the routine, and the reward. Once you did it, you’re ready to read the next part on how to create your daily programming habit.

How to make programming a daily habit

All you have to do to make programming a daily activity is to create a routine.

You are free to define what you want for each part of a habit, but I will give you a few tips to help you.

For the cue, you can try to define something based on time:

  • Every morning right after I wake up
  • When I come back from my daily work
  • At my lunch break
  • [Insert a time-based cue]

Routine will be our most straightforward element to define. You can just say, I want to code for 30 minutes, or I’m going to learn [Insert a skill] for 30 minutes, many more.

Finally, one of the most critical parts will be the reward. As I recommend in the first part of my first productivity article, you need to establish goals for yourself. It’s going to help you to define a reward. Every time you accomplish your habit, you are closer to your goal.

Try to determine a long term goal, and inside of it a lot of small goals.

For example, you can say:

  • I’m getting closer to my goals for the week.
  • I’m getting a little closer to my final goal.
  • If you code right after your wake up, make yourself a breakfast as a reward.
  • [Insert a reward]

A challenge that can help you

One of the best ways to get into a habit is to follow a 100DaysOfX challenge. This challenge is designed to help you create a pattern and commit to it every day by sharing what you did on Twitter, Instagram, or your blog.

The reason I’m telling you about this challenge is that it became famous on Twitter by the 100DaysOfCode.

I strongly recommend that you read the rules on the site and get started. You’ll see, at first, it may seem big and impossible, but you’ll find it fun to do so.

Besides, you will most certainly get support on Twitter, which will motivate you.

Are you passionate about self-improvement? Eager to change your habits, have tried to do so many times, but had difficulties changing them? Life always seems to get in the way, there is not enough support, and you feel like you’re alone in it? Find yourself thinking, “What’s the use of all this self-improvement if I always seem to go back to where I started from?


If I recommend this challenge to you, it’s because I’m doing it. I’m thrilled with the results, and I’m only starting. For my part, I’m doing the 100DaysOfReading challenge. I always wanted to start reading but I never took the time to do it. Thanks to this challenge, I’m on day 17, and I finished one book and half of another one.

My habit loop:

  • Every time before lunch or before sleeping if I haven’t had the time (the cue).
  • I read almost 20 pages or more (the routine).
  • I am approaching my long-term goal of reading daily. I am close to my short-term goal of finishing the book. It makes me happy because I have always wanted to read daily. (the reward).
  • I publish a quote from the book I’m reading with some explanations and motivational text on my Twitter (the commitment).

Some points that can help you to create your programming habit

Plan your tasks

To work every day and achieve my monthly goals, I plan all my tasks the evening before. I put on paper what I want to make, and every time I do it, I’ll scratch it off my writing. I recommend you to do this with your daily programming habit because it’s going to motivate you and satisfy you a lot when you finish all your goals.

If you need more structure in your work, you can define: what you are going to do, how, when, and why.

For example, I’m going to create a landing page for my website (what I’m going to do). I will use Vue.JS to build it (how). I will do it between 8am and 10am (when). It’s going to help me better understand Vue.JS and help me to start getting the email of my visitors.

Code your dream project

What could be better than coding daily while working on the project of your dreams? If you need motivation, it’s an excellent way to do programming every day. Don’t be afraid to take the initiative. Doing it a little bit every day will motivate you even more and give you results in a short time.

Find the subject you want to work for

The world of programming is vast: web, software, AI, embedded, and many more.

One of the significant difficulties is to define what you want to do as a programmer.

It’s not easy for everyone, but choosing a topic and stick to it can be a good motivation factor to practice daily.

For example, if you choose web programming, you can just focus on it. Even if it stays a big topic, you removed the software, AI, embedded, and others. That’s a good start.

To go further, you can choose between the front-end and back-end.

I’m telling you all this because often, when you start, you get demotivated fast because there are too many things, and you can’t focus on a specific theme.

A good environment

Something that can motivate you in your daily programming habit is a pleasant working environment. I do not recommend to work in your bed. You’re going to be tired easily.

Try to work on a desk or a table and do whatever you need to feel comfortable in that space. It will make you want to work more efficiently.

Further reading

If you are interested to know more about the habit process. I invite you to read “The Power of Habit” by Charles Duhigg. This book helps me a lot to create this article and a lot of examples I gave you are inspired by it.

I’ve also heard about “Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones” by James Clear. This book is going to offer a framework to improve your daily habits. The author tried to provide a kind of practical guidance on how to make changes.

Do you plan to make programming a daily habit? Are you going to commit to 100DaysOfCode?

Thanks for reading. Let’s connect!

➡️ I help you grow into Web Development, and I share my journey as a Nomad Software Engineer. Join me on Twitter for more. 🚀🎒

Gaël Thomas

Getting started on a solopreneur journey alongside my 9-5 🚧 Documenting my learnings and progress on Twitter (X) ✍️ Software Engineer 💻 My latest project: BooksByMood 📚

Post navigation