
If I don’t practice one day, I know it; two days, the critics know it; three days, the public knows it. – Jascha Heifetz
In the last post we learned how to recognize the difference between hard skills and soft skills. Now let’s dig deeper into how to develop hard skills. Hard skills aren’t necessarily difficult to perform, but their “hard”ness comes from their being well-defined and precise.
In developing a hard skill, we aim to create “muscle memory.” This is really a property of our brain cells to create stronger connections as we repeat an activity. This is why habits are hard to change. Our brains are “hard-wired” to do a particular action.
With that in mind, to create a new habit, or skill, we want to break it down into it’s fundamental components and master those fundamentals very carefully. Musicians practice scales regularly to keep their skills fresh. When I learned to play piano half a century ago, I used a book called “A Dozen a Day“. It was a set of piano key fingering patterns that you practice over and over so that it just becomes natural to do them correctly. And those fingerings map onto any musical piece you would play.
So what if we want to master refactoring skills? There are a number of fundamental refactorings that we need to have mastered. Most of these are automated refactoring functions in your IDE. Even if the IDE does it for you, it’s good to know how to do it by hand in case you have to work in a different environment that doesn’t have them automated. And when you use them, it’s good to know the keyboard shortcuts to implement them so that when you recognize the problem you can quickly implement the solution.
But how do you practice that? There are katas that are good for helping to practice. If you are wanting to learn the basic techniques there are books that walk you through the steps. Working through these (as I have been doing recently in my Virtual Brown Bag sessions) can make these fundamental refactorings second nature. These books help you to recognize the code smell and then apply an appropriate refactoring. Sometimes there are multiple options, and these books give you insights on how to choose the best one.
Give some of these a try. Set aside some time at least once a week to practice refactoring fundamentals. Practice them until they become second-nature. Then combine them and practice them in different ways – use a different language, or limit yourself to using functional style coding, or pair up with a buddy to practice refactoring AND pairing! Get creative. If you have other ideas, please share them in the comments. Keep calm, and refactor!

