Maybe, the first thing that comes to your mind when you hear the word "KATA" is a movie of Bruce Lee or maybe, the movie Kung Fu Panda 😛. According to Wikipedia Kata is:
"Japanese word, are detailed choreographed patterns of movements practiced either solo or in pairs. The term form is used for the corresponding concept in non-Japanese martial arts in general."
In other words, a set of movements very well synchronized which simulate a fight in the real life, and the more you practice those movements, the better you become at fighting.
But....we are going to talk about Code Kata , instead of practicing how to kick and throw punches, we are going to practice by writing some beautiful code.
The first time I heard the term "Code Kata" was in the book The Clean Coder by Robert C. Martin, but the original term was credited by Dave Thomas in his book The Pragmatic Programmer.I recommend them both in my post Books you must read as a developer.
What is Code Kata?
It's a code challenge focused on improving skill and technique. Katas come in different ways, some train programming fundamentals, while others focus on complex problem-solving. You can also find katas with mathematic problems, data structure, games, design patterns and puzzles, meant to test your creative problem solving, while others are based on real world coding scenarios. You can do it alone, in a pair or in a group, I love to do it in a group because you can see how others approach the same problem in a different way.
Why Code Katas are important for any developer?
Let me answer this question with another question: How do you get to be a great runner or great tennis player or great musician? Yeah, you got it, the simple answer is by practicing. It helps to have talent, it helps to know the theories behind... but to be a great developer you need to practice to enhance your code skills. As Robert C. Martin says, it's not enough code from 9 AM to 5 PM in your workplace, to be a great developer you also have to code in your home. Practicing is the key. Therefore, when you are facing a problem in your work or in a side project, you will know which technique suits better for that problem, because you practiced already in a similar kata.
Where can you practice your Code Katas?
There are many pages where you can improve your code skills, right now I'm using with my friends codewars.com, we set 1 or 2 katas weekly and after everyone finishes it, we compare and give a feedback to each other. I invite you to try it out, you won't be disappointed.
If you are new doing katas and you want to use codewars.com, I recommend you to start with the low-level difficult katas (Kyu 8) and then select the more difficult ones as you progress:
I will end up with a paragraph from a post of Jeff Atwood, co-founder of Stack Overflow :
" It's an important distinction. I may drive to work every day, but I'm far from a professional driver. Similarly, programming every day may not be enough to make you a professional programmer. So what can turn someone into a professional driver or programmer? What do you do to practice?..."