Code Kata: The Art of Code

The best way to become a better programmer is to write more code. But what kind of code should you write?

Veteran developers often recommend Test Driven Development (TDD), and I agree. But how can you transition from a chaotic coding approach to the more organized and strategic method of TDD? The key is to start small and gradually build your skills — and that's where "Code Katas" come in.

Code Katas are similar to the katas practiced in martial arts: a precise set of movements repeated over and over until they become second nature. The term was first introduced by Dave Thomas in the book The Pragmatic Programmer. In the context of programming, Code Katas are small sets of problems that you solve by following these steps:

  • (a) write a test,
  • (b) watch the test fail, and finally,
  • (c) write just enough code to pass the test — a process also known as Red, Green, Refactor.

If you’re looking for some Code Kata problems to sink your teeth in, you can find them here:

https://sammancoaching.org/