15: Code Kata - A Practice Arena for Becoming a Better Programmer
Published 2/6/2015
What was the last time you practiced writing code? Any expertise arguably requires an intentional, focused effort on practicing a set of exercises. Kata acts as the practice exercises for programming.
In this episode, I talk about code kata, and I also talk about the danger of being addicted to problems, and making sure we keep our kata efforts separate from our real problem-solving efforts.
If you enjoyed this episode, please consider buying me some tea.
Transcript (Generated by OpenAI Whisper)
Hello everyone and welcome to this episode of Develop Our Team. My name is Jonathan Cutrell and today we're going to be talking about Code Cata. Cata is a very difficult word to pronounce. I didn't know how hard it was to pronounce until I tried to re-record the intro to this episode like five or six different times. So instead of calling it Cata for the sake of not mispronouncing it, I'm going to call it Code Practice, right? Because I think that's the better descriptor for it anyway. Dave Thomas is the founder of this concept, Code Cata. Code Practicing and basically what Dave says about practicing code is that it's kind of like being a musician, right? Being good at being a musician requires that you sit down and you practice theory over and over and over. He makes a sports metaphor and says that you don't tell a bunch of young athletes that they have four quarters to beat the redskins. And obviously that would be insane. That would be out of bounds. They wouldn't be able to do that because they don't have the experience necessary in order to do that. So if you aren't familiar with what Cata is, it's basically a set of predetermined problems and you approach these problems in code and you write whatever code is necessary in order to solve those problems. And usually they have relatively prescriptive solutions that you can look up and determine whether or not the code that you wrote is adequate. Now there's a lot of different types of Cata. Some of them require a certain runtime for instance. Some of them require that you optimize your code so that it runs very quickly. Some of them require that you write the code without using particular constructs. For instance, they'll require that you re-implement particular functions of a given language. So in JavaScript you might re-implement a constructor function or scoping. Cata is I think I'm a little torn on Cata and here's why. I believe that we as programmers are kind of addicted to problem solving. We get a high when we write code that solves a particular problem, which is relatively a good thing. We enjoy writing things that are useful. We enjoy writing things that are accurate that provide a result that we were looking for and we should. We should enjoy writing those things. However, when we get so addicted to problems that we start looking for problems that already have solutions and we rewrite those solutions over and over, we aren't really providing ourselves any value. The solution already exists. So what are we doing to better the world by rewriting the same solution over and over? Well, I think Dave Thomas would say that Cata, the goal of Cata is not to solve a problem. It is to create a better programmer. So let me say that again, the goal of Cata is not to give you the high of solving a problem. It's not to accomplish the goal of solving that particular problem. Instead, it is specifically intended to give you a practice arena to turn you into a better problem solver. Now that is a fundamentally important concept for any line of work, but as Dave says, it's difficult to see that at play for programmers. We often learn on the job. We often practice on the job, which is very high stress in a lot of the time when we practice on the job. We unfortunately, we can't explore and learning is an exploratory practice. And actually having a space that is dedicated to learning, actually having the space to say, I know what the solution is. And I know what the starting point of the problem is. Now let me learn about different ways to go from the beginning of the problem to the solution. For example, Cata is a fantastic way to learn a new programming language because you don't have to, you don't have to really solve the problem, right? That's not the point. The point is not how do you solve this problem. The point is how do you write the code? And that ultimately is the thing that you are practicing. You're practicing sitting down and whether it's syntax or if it's thinking about a particular algorithm or maybe it's just simply translating what you have already created as the solution in your mind into a new paradigm. All of these particular aspects of Cata are valuable and they do provide value to you. They are not intended to solve those problems. Now that seems obvious, right? It seems like that's the obvious truth. However, I would argue that a lot of us end up bringing over the Cata mindset into our project work and that's where we go wrong. That's kind of the secret, right? That is where we need to pump the brakes and say, wait a second, do we already have a solution to this problem? For instance, how many times have you cut yourself writing the same slider, the same carousel if you're familiar with carousels? How many times have you written that same code? How many times have you written that same WordPress loop or that same particular chunk of HTML or that same Ajax call? How many times do you rewrite the same code to accomplish a real goal? Because truthfully, you aren't learning from that. You aren't becoming a better programmer by rewriting the same things the same ways. When you choose to engage in practicing programming through Cata, it is a protected space where you're intentionally trying to get better, not passively rewriting the same code over and over and over. I hope you've enjoyed this discussion on Code Cata. If you are enjoying this show, please drop into iTunes and leave a rating and review. This is the most important thing to help other people find the show. iTunes uses these ratings and reviews to actually sort the shows and to promote them. So if you leave a rating and review, it helps us out tremendously. If you have any comments, if you have questions, if you just want to talk, or maybe you even want to be on the show with me, you can get at me on Twitter at Act Developer Teaor you can email me at Developer Tea at gmail.com. You can also go to developertea.com where you'll find a contact link in the header. Until next time, enjoy your tea.