Develop Better Programming Habits
As a programmer, we often have the tendency to develop many bad habits because of the ever increasing complexity, communication overhead and constant learning in our jobs. Sometimes, we even sit for hours trying to understand a domain specific issue for example, understanding how TAX works for a particular foreign country’s region. Even trying to learn a new Web Technology or the latest trending Front End framework is demanding. I took a few days to become productive in AngularJS at first. However, I initially found Angular more complicated because I had to also learn ES6, TypeScript and the wealth of different ways to accomplish the same things (FormControl). ReactJS was more straightforward but learning the component life cycle, the use of Redux and fetching data from remote were going to take full mental effort.
I know some software developers who were lean, fit and looked good when they started working. Nonetheless a few months later, their belly fats were the first thing to notice when meeting them. They looked they amassed a few more weight. They looked lethargic. Some depended on coffee to get running. A lack of exercise, bad eating habits but also sitting down too much during the day after all had noticeable consequences.
Nowadays, sitting is the new smoking. Ironically, many of us, move, go outside only to smoke. As programmers, it’s difficult to change our habits. We are almost not aware of them, for example, eating a snacks every now and then while coding or not drinking enough water during the day. By the time we notice it, it’s often too late or painful to change. We delay deciding on doing something to address this situation.
During my time as a professional software developer, I observed colleagues avoided eating in order to lose fats. However, as a side effect, their productivity were also impacted. They also tended to be more easily irritated. I myself tried Intermittent Fasting at work a few times, but had difficulty focusing for long stretches of time in sessions of intense coding. If you want to lose weight, not eating is certainly not the way to go.
“Willpower isn’t just a skill. It’s a muscle, like the muscles in your arms or legs, and it gets tired as it works harder, so there’s less power left over for other things.” — Charles Duhigg
As I completed the bestseller, The Power of Habit by Charles Duhigg, I began noticing bad habits and ways to change them. According to the author, one does not stop a bad habit, rather he or she replaces it with something beneficial. A good friend of mine replaced his smoking habit with drinking soda that he later replaced with succulent fresh fruits juice.
Ideally, if you have the intention of doing the same, start by having a keystone habit. A keystone habit is one that makes changing other habits much easier and manageable on the long term. For instance, exercising in the morning for some people makes them more conscious about the quality of the food they consume, who they socialise with and the amount of sleep they get at night.
“Typically, people who exercise, start eating better and becoming more productive at work. They smoke less and show more patience with colleagues and family. They use their credit cards less frequently and say they feel less stressed. Exercise is a keystone habit that triggers widespread change.” — Charles Duhigg (The Power Of Habit)
To change a bad habit :
- Become aware of the habit itself
- Decide to change the habit
- Believe you can change it
- Identify the cue, routine and reward
- Identify your brain craving for this particular habit
- Replace the routine for something beneficial
- Experiment what is best for you
- When I am in the zone programming, I often forget to drink water during the day.
- Therefore, I feel dehydrated. I find I cannot keep the same level of productivity and I feel less good. I prefer sustaining my productivity while letting my body be balanced
- I don’t like to focus on only one task until I complete it, but not drinking water is harmful
- Cue: When in the Zone and feeling thirsty, Routine: I continue working instead of taking a quick break to drink a glass of water or two, Reward: I want to complete the current task while I am still in the zone
- My brain does not want to switch context because I feel good upon completing a task. My brain releases dopamine for a reward for the effort I put on doing it.
- I can get the same rewards while reducing any context switching by having a bigger glass of water so that I do not need to physically move around which will most probably distract myself particularly if I talk to someone. I then have to put effort again to continue where I was.
- I can experiment with several situations as taking frequent breaks is highly recommended for people sitting down and staring at the computer for long hours. By breaking down my assigned task to chunks that are easier to manage, I can then take breaks in between.
“The key to victory was creating the right routines.” — Charles Duhigg