Wax On, Wax Off
In the 1984 film, The Karate Kid, the lead character, Daniel, seeks the help of Mr. Miyagi to learn karate so he can defend himself against bullying kids from an evil dojo. Daniel’s training begins, not with learning karate moves, kicks, and punches, but with menial tasks which to Daniel are pointless and a waste of time.
In a now iconic scene, Mr. Miyagi instructs Daniel to wash and wax his cars (he has several) using a specific circular motion. “Wax on, right hand. Wax off, left hand.” Daniel had just agreed to do whatever Mr. Miyagi asked him to do, no questions. He was stuck. Feeling more like a servant than a student, Daniel reluctantly works the rest of the day and into the night doing this ridiculous wax on, wax off thing.
Daniel didn’t realize it, but Mr. Miyagi was training Daniel’s ‘muscle memory.’ What looked like a menial task was really a kata.
What is a Kata?
Kata is the Japanese word for ‘form’. It refers to a set of standard postures and movements that practitioners of Japanese martial arts, such as Karate and Kenpo, practiced with the intent to develop their muscle memory so they can execute them flawlessly every time without conscious thought. It takes much time and practice to master these moves, but once mastered they can be deployed in an infinite number of combinations based on the needs of the situation.
It is obvious how this concept can be applied to a physical skill, such as a martial art, athletic endeavor (golf, gymnastics, figure skating), or in learning to play a musical instrument, but how does this apply to knowledge workers? In particular, is the concept of a kata useful for software developers?
Kata are Useless
When kata were first proposed as a means to improve software development skills, the predominant idea was to solve the same problem over and over again as an exercise. I didn’t see the value. Simply writing the same thing over and over again did not make much sense to me. I was not alone. In a 2013 post on his blog, The Simple Programmer, John Sonmez says “Doing the same thing over and over again does not make us better at it.” He likens it to walking. We walk all the time. Are we really getting better at it? A better example is typing. As developers we type all day long. If just mere repetition made us better, then I should be typing 900 words per minute with no errors. For the record, I don’t.
Cognitive science bears this out. Unless we deliberately try to improve at a skill, we eventually reach what is referred to as the “OK plateau.” We are satisfied with our skill and do not see the need to apply more effort to improve. Typing is a perfect example of this. Walking works as well.
Cognitive science has also discovered that when we repeat the same activity over and over, such as reading and re-reading text, we become familiar with the terms, but really haven't gained any knowledge or understanding. It's called the "fluency trap." You've no doubt experienced this when you tried to relate a concept that you have "studied" (read the text multiple times) to someone, but cannot for the life of you explain it intelligibly. You thought you understood it, but you were sadly mistaken.
In this sense, kata are useless. Sonmez is right. Just doing something over and over again does not make us better.
The problem with our earlier struggles with kata is that we were working with the wrong definition of kata. A kata is not just doing something over and over. A kata is practicing a skill.
What skill are we practicing when we solve the same problem over and over again? It’s not problem solving, since we’ve already solved the problem and are just implementing it repeatedly. We could, as Sonmez suggests, claim that we are learning the shortcuts in our editor, but if I wanted to focus on learning the editor, I’d do exercises designed for that specific skill and not go through the mental effort of solving a problem.
Recommended by LinkedIn
What good are kata, then? Why bother if they don’t help?
Kata are Vital
I think they do help. In fact, they not only help, they're an important part of a programmer's continuing professional development.
For one thing, we’re not just mindlessly solving the same problem and writing the same program over and over again.
I don’t know of anyone these days that advocates the type of kata that Sonmez opposed in 2013. I’m not sure how many existed back then, either, but I know they were there because I remember reading them.
If we choose to solve the same program these days, we introduce some variation into the process. This ensures we are exercising creative judgment that we would otherwise not employ. For example, we can use an unfamiliar language or restrict the language constructs we’re allowed to use. We may add arbitrary constraints such as pairing with a new person each time, or forbidding verbal communication between the members of the pair. Code retreats are a good example of this process and can be highly effective.
Secondly, we have, or should have, specific skills that we want to master when we perform a kata. We want to get better at pairing (it’s a skill!). We want to gain experience with TDD or BDD or BFD or whatever the new hotness is. Perhaps we do want to learn our editor better or we’re trying to get faster at the keyboard (I need this badly). Regardless, we have something specific that we want to take away from the exercise.
Finally, if we perform kata with others, it gives us an opportunity to work with folks that challenge us and help us improve. This may be the greatest reason to participate in kata. We’re better together and we learn better together. One vital element of deliberate practice is immediate feedback, usually from a mentor or coach. Peer feedback can be just as helpful, though. If we practice alone and get it wrong, we are building an anti-skill that must at some point be unlearned.
Embrace Kata
Aside from my day-to-day activities as a software developer, I have a number of things I do to keep improving and hone my skills. I read (or listen to) a variety of books, articles, and blogs. I take online courses. I participate in user groups and in a technical book club. I discuss software development with my dev friends. I have side projects that I work on.
There is nothing I do that is more valuable than kata. There is nothing that keeps my coding skills sharp and gives me confidence the way that writing code does.
The good news is that there are kata everywhere. Just search for 'software kata' online and you'll have a plethora of kata sites to choose from in whatever technology stack you are most comfortable with. It is truly and embarrassment of riches.
Like Daniel, you may view software kata as some useless, menial task, a digital version of “wax on, wax off.” I can’t promise you that it won’t feel like that at times. If you make kata part of your improvement regimen, though, I think you’ll be surprised at how much better you become as a software developer and as a problem solver.