Routine not Goal

Having goals is good. Many advice that people should have clear goals. I do have some at the beginning of each year. Things like "I wish, I will, …". I promised to myself to do this, do that. But soon enough, I forgot most of them. Time goes by very fast. At the end of the year, I realized that nothing had changed. Another cycle starts with the next year.

Of course, I accomplished some. And I still set goals for every year. It is a good practice. However, I realized some problems with setting goals—the emotion. I felt excited, determined at that moment. That excitement faded quickly—end of January at max. And the mind started to do his best job—finds good excuses for not doing anything related to your goal, it keeps you where you are. Sometimes regrets came at the end of the year.

It is an endless loop—promise – regret – promise. I realized there is another way—routine, habit. Developing good routines/habits is the key.

What I want does not matter much. What I’ve done matters most. I had goals, but I still kept the same routines—did the same thing everyday. How could I expect different outcome? Maybe that is the definition of stupid.

People are afraid of changing. They just do not realize that.

This year, 2020, I decided to build new routines/habits. They must be

  1. Small and easy
  2. The good ones that support my bigger goals
  3. Supporting me to become a better of me

I’ve started some since October 2019. Here is my list

Instead of wishing healthier

I commit to do 100 push-ups everyday. Some day I missed, but that was ok. I do not have to do it at once. I do 50 after I get up in the morning. The rest is in the afternoon.

I commit to do 50 sit-ups every morning—after 50 push-ups. While resting between 2 exercises, I prepare my coffee.

Push-up, sit-up, and making coffee cost me just 15 minutes. A very good use of my time!

I commit to run on treadmill for 1 hour, 3 times a week. It was hard at first. But after a month, I felt comfortable, sometimes not, with the time on the treadmill—It was hard to discipline in a boring treadmill for 1 hour. Some weeks I missed 1 or 2 sessions. That was ok. I did not consider a failure or breaking the rule. As far as I do not quit, it is going to be fine.

Instead of wishing well-organized

I commit to plan my day early in the morning—after the exercises. I simply write down what I want to do in that day—use Microsoft To-Do app. I like the My Day feature—allows me to jot down what I want to do without thinking too much about categorization, prioritization. After 2 months of practice, I started to feel it as part of my daily routine. It is a small routine, cost me 5 minutes.

Instead of saying I will focus

I apply the Pomodoro technique—working in a block of 25 minutes uninterrupted. I did not believe at first when I knew it 5 years ago. However, I decided to commit to it since last month. I am glad I did try it. Over the time, It gives me the confident that I can deliver something if I focus on it for 25 minutes. After that period I can stretch my body, take a breathe and then start another 25 minutes. If you want to make a change, try it. Do not question whether it works or not. Just do it.

 

Those are just a few that I have started. After 2 months, I can sense changes—in a good way.

Small Things Matter: Naming

Naming is hard. But we can improve and make a difference.

As developers, we write code for a living. Most of the time, we pay attention to solving problems, learning new technologies; kind of new cool stuff. We tend to ignore or look down on small things.

There are so many small things. Well, in reality, everything is small things. Big is just a sum of small things. Naming is one of them.

Dear developers, what is on your mind when you heard about “Naming”?

  1. Project name
  2. Class name
  3. Method name
  4. Interface name
  5. Property name
  6. Variable name
  7. Hardcoded value

They are all matter. Why? Because they help us__human being__can read the code. They help us understand the logic by just looking at the signatures.

In the technical jargon, we call readability.

Let’s take a look at “Hardcoded value” and “Variable name”. They are pretty much the same thing. I have seen many places that developers name a variable: b1, b2, … They have the same problem:

They give no meaning at all

Number Cannot Speak

Take a look at this code. I am sure all C# developer knows

    public class BadNaming
    {
        public void CanYouUnderstandTheLogic()
        {
            Thread.Sleep(180000);
        }
    }

The code says that: Should sleep (block and wait the current thread) for 180000 milliseconds.

What are the issues with that code?

  1. As a reader, I have to convert 180000 to a meaningful concept that my brain can process, Ex: Second, Minute, Hour. As a human, we do not usually deal with milliseconds.
  2. What is the logic behind the sleep? Usually, developers will write inline comments. (Hint: You should do a quick search and will know that inline comment is not a good approach)

The number itself cannot carry meaning. It cannot speak what it means.

Give It a Meaning

Now take a look at this code. What do you think?

public void GiveMeMeaning()
{
    var sleepThreeMinutes = TimeSpan.FromMinutes(3);
    Thread.Sleep(sleepThreeMinutes);
}

The Thread.Sleep method can take a TimeSpan. Usually, developers forget that option.

With a little change, I can assign meaning to a number. The code can self-explain its meaning.

No matter what languages you are using, there are primitive types that convey, naturally, no meaning. When you use them, think about the other person (maybe you in a year) will read that code. They have to spend time investigate the meaning.

I just pick a small corner of the problem with the hope that you get the idea and pay more attention with your code. Someone will thank you and call you a professional.

Professionalism is nothing than caring for small stuff.