The fact that habits are usually hard to develop and, more importantly, maintain for a long time, is really nothing new. I’m pretty sure that almost everyone has at some point in their lives wanted to build a new positive habit or has known someone else who also did. Whether it was the habit of working out, eating a balanced diet or developing a healthy sleep schedule, it’s safe to say that everyone did it so their lives would improve in some aspects.
However, it’s very likely that you at least struggled to maintain that habit and in the “worst case”, you abandoned the habit completely. Spoiler: you’re not the first person to do this, nor the last one. There’s hundreds of self-help books, articles and conferences that talk about this, not only because it’s so common, but also due to the importance of habits in the process of becoming a better person and, in this case, a better developer.
Why you should code every day
Learning to code and to make practical solutions using it is by itself a hard enough task. Coding everyday seems like an easy thing to do, until the day where the only thing you want is to lay in bed and do nothing. As said earlier, habits are hard to keep and in this case, is coding every day really worth it?
By coding every day you will be practicing constantly, even if some days you don’t learn as much as others, so the new concepts and knowledge you get along the way will be easier to understand, memorize and apply in your future projects.
Coding every day could even be considered a challenge, an opportunity to prove not to other people, but to yourself, that you are capable of learning and strive to improve.
Consistency and motivation
The theory behind habits is to make something like a task or activity fully automatic: something you do effortlessly. When you think about a habit in this way, the more consistent is the process, the better. This consistency may be in the shape of schedule, location or even people around you, but it’s an essential factor for habit building.
Yet consistency is likely the number one reason we fail to maintain our new habits. Although there exist many causes for this, lack of motivation might be the most common.
Motivation is often something we don’t have control over: some days you wake up motivated and some you don’t. Giving more weight to motivation in your process of developing a new habit is a mistake, since it’s something that’s not consistent. While it’s important to decide to build a new habit based on your motivations as a person, a habit is something you want to be able to do every day, even if you aren’t motivated.
This is exactly why you must depend on discipline, not motivation, in order to maintain your habit. Unlike motivation, discipline is an ability that you actually can develop with time and that is key to getting control over your life and being able to not make the decisions you want, but the choices you need.
Starting easy is something that’s really useful when you are building the habit of daily code. It’s really common to talk about this when it comes to going to the gym and working out:
“You can start developing the habit by simply putting your exercise clothes on and getting on your car.”
Setting aside dedicated time, getting on your computer and coding some lines, even if it’s just for 10 or 20 minutes a day can really make the difference when it comes to getting started. The quality of the work you do doesn’t really matter at this stage, it’s something you can work on once you develop consistency. Keep in mind that this is just a useful strategy when it comes to building new habits.
It’s also useful to remove the “opposite factors” of your new habit. For instance, if you want to develop the habit of healthy eating, you might want to buy less candy or fast food.
I know, when you want to code and the opposite factor in your case is watching content or playing video games in the same computer, it may be slightly harder to remove them. But what you can do is to setup your environment so it’s harder to do something else when you feel the desire of doing something else instead of building your habit.
You can do this by customizing your text editor to your liking, removing direct access to “non-productive” apps or restricting the time. In the end, self-control is really hard to develop as well: “why should I do something today when I can relax for now”. It’s a matter of spending time with balance, which is, you guessed it, hard.
How to measure the habit
Habits can be hard to visualize. Do you focus on the amount of days? Maybe the quality of your work in those days? Turning your habit into something you can observe, rather than something you just experience, will help you get feedback that’s measurable.
- You can try out using habit-tracking apps or maybe even a bullet journal. While they are effective methods for building habits, I think there are more options that are better for code-related habits.
- GitHub provides a daily commit record, where you can see how many commits you have made in the last year. Not everything you code can be with a git commit, though, so it’s not a perfect method neither.
- Working on projects is a great way to practice code, learn about the development process and end up with something you can use as a reference to keep track of your progress. You can even host your projects on GitHub or on a personal portfolio site in order to show your work to the world.
- You may also be interested in the 100DaysOfCode, a challenge where programmers code for at least 1 hour, for a hundred consecutive days. It’s an option that might be a fit for some people.
The process is hard and often tedious, so don’t be disappointed if you can’t keep up on your first try or if your daily schedule just won’t allow you to take time for coding. Instead, focus on the difficulties you were faced during that period and how you might overcome them.
Building a habit is similar to the process of growth of a plant. Yes, you will need to dedicate resources like time and energy in order for it to grow and yes, it might not work out. Some experts say a habit takes thirty consecutive days, some sixty. It’s just a matter of time and consistency for your little sprout to grow into a tree.