Saturday, November 5, 2016

How to use Code Katas in Deliberate Learning

I recently watched Dan North's video on Deliberate Learning vs. Deliberate Practice and I wholeheartedly believe in almost everything he said. I do believe that we should really know how to learn as efficiently as possible, which is different for each person. I also believe that we should go to meetups, listen to podcasts and various other methods of quickly learning what the trends are and what the new tech is at a shallow level. Then we can prioritize what we want to dig deeper into and learn more about.

What I did not fully agree with is that code katas were not the way to achieve deliberate learning. (https://youtu.be/SPj-23z-hQA?t=362) On their own katas and the metaphor may not be the right thing we need, but if you take the coding challenge tool itself and apply it in a different way then the kata will be more effective.

For example, the JavaScript group I am apart of at Sogeti has started a weekly coding challenge based on CodeWars katas. While I agree that development is not about writing the same code faster, it is about writing more maintainable, performant, SOLID, and clean code. The first time I write code to solve a problem will probably not be the best solution. I can then look over my code and compare it to other solutions and see if I can use built in functions, break out functions into smaller functions that make more sense, or use recursion.

I am currently learning about JavaScript arrays and the built in functions. As I complete these challenges I am going back and looking for places where I can use these built in functions. Instead of writing loops I can just use what is available. I’m learning to use what is in the language instead of reinventing the wheel. This can also be done when learning the new features of ES6.

I have also started a brown bag meeting to discuss our solutions as a group the day after a coding challenge is finished. At this point, we become the sensei and teach other what could have been done in a more efficient way or if a function or variable could have been written in a more readable manner. This code review is where the real value lies in doing code katas.

Dan North mentioned “Learn Python the Hard Way”, which is a series of exercises that force you to code and learn the python language. This is very much the same style of learning that I want to achieve except that I would like developers to redo the same exercise with a new way that they just learned. This would cement the new way in their mind.

Next time I start a new project and I have to write code that is similar to something I wrote, I will now be confident that I am aware of different ways of writing that code. I will also be confident that it is more readable, maintainable, and performant.

No comments:

Post a Comment