Using Pain as a Trigger to Positive Action

Recently I gave a talk titled "Evolving with Java - How to Remain Relevant and Effective" in GIDS on the Java Day of the conference. The talk was centred around using pain as the triggering point for positive action.

Let me tell you the incident that triggered this thought. It was the early days of my, and I was working on the first feature in that project. I had to create a logger object and log certain information. The project was using a custom extension based on log4j. Since I wasn't familiar with the API, I decided to copy paste the code which creates a logger object from an existing class (It was a Java project). Let me present the equivalent code in Slf4J so that you quickly understand what I am talking about.

package com.nareshak;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MyClass {
    private static final Logger LOGGER = LoggerFactory.getLogger(MyClass.class);
}

However, I committed a blunder. As you might have guessed, I had forgotten to change the class name. Hence if I search the logs with the class name, I couldn't find anything. I felt the pain because it took me several hours to figure out my mistake. Once I found out my mistake, I wanted to ensure that I don't repeat it. Fortunately, I already had potential solutions. I used the code template feature available in the IDE, which would generate the code taking the value of class name from the declaration of the current class.

Though I was aware of this IDE feature earlier, I was not motivated to implement it. However, the pain triggered me to take action and implement the solution. What is important here is your sensitivity to pain. Earlier you sense the pain, quicker you would learn and grow.