Skip to main content
Mastodon

Code Katas

There is a lot about what code kata is on the web, but I will allow myself a brief introduction anyway.

Code kata is simply a coding exercise. It’s your testing ground for learning new technologies, frameworks, and libraries, as well as comparing different approaches, without the pressure of a real-world project. Your goal is to create a minimal implementation of some project, allowing you to focus on specific learning objectives. The excercise should not take too much time (I prefer to not exceed 1 hour). You can skip some practices that you would do in a real project, such as input validation, authorization, etc., and focus on what’s important to you right now. However, I recommend that you continue writing tests, especially in the TDD approach.

Here are just a few of the skills you can develop. The list is open and can be extended, so let your imagination run wild :)

  • new programming language
  • frameworks
  • libraries
  • algorithms
  • domain modeling
  • test driven development
  • testing approaches (classical vs London)
  • SQL and NoSQL databases
  • architecture
  • ORMs
  • development for the backend, frontend, mobile, or desktop

Katas and pet projects

I think both, katas and pet projects are great ways to practice programming. The great thing about katas is that they’re simpler and more short-term than pet projects. Sometimes you can even write the same kata several times. It’s a great method to learn a new framework or programming language. Once you’ve solved a problem, it’s so much easier to focus on what you want to learn instead of the problem itself. It may not even be executable, it may just pass the unit tests.

On the other hand, pet projects can teach you skills that code katas don’t - like refactoring, maintenance or problems that appear in the project on a larger scale (e.g. related to performance or complexity). Also, it’s more likely that someone will find your pet project useful than a kata.

Finally, you may find that you would like to develop one of your katas into a pet project. Exploring katas can be creative and inspiring, so I strongly encourage you to practice them.

Advices

Based on my own experience, I would suggest:

  • Keep your kata simple and focus on what you want to learn. Remove anything that’s unnecessary.
  • You can do the same kata multiple times, but if you do, do it in a different way or with a different tech stack to keep learning something new.
  • Do not overcomplicate.
  • Do not use a real database if you are learning something that is not related to the database. Use in-memory repositories instead.
  • The project does not always have to start up. You can, for example, write a model or a library that passes unit or integration tests.
  • Don’t start implementing right away, first plan what you want to achieve.
  • You don’t need to implement an ready-to-use application, you just need to create, for example, the backend alone or the frontend alone.
  • Have fun! ;)

Also, sometimes I go back to my katas and add some extra features. For example, if I want to quickly check some validation library, I can use some of my existing projects instead of creating a new one.

List of katas

This is a list of my ideas for code katas. I’ll be expanding this list over time, so if you visit this article in the future, it may contain more ideas. Some of the projects are projects I’ve implemented myself, and when I think about implementing a new kata, I look at this list first.

  • Issue Tracker
  • Kanban Board
  • Concert ticket shop
  • CI Executor
  • Test Runner
  • MUD Game Engine
  • Markdown parser
  • Obviously: “The TODO List”
  • Comments API
  • Simple CRM
  • Authorization server
  • Metrics exporter
  • Your own “Tamagotchi”-like game
  • Music player
  • Calendar widget
  • Tic Tac Toe game
  • QR/Barcode generator
  • Simple IoC container