About Koans

February 6, 2018
Koan Scala Kata TDD

Today we started out our kata sessions with a brand new kata. The kata is about finding the numbers of triangles can be created from given lines. Even though my collague Evren already came up with a solution in his blog post, we wanted to resolve this kata with TDD approach. We will abstract each logic and write a unit test to ensure that the logic works as expected. These abstractions will lead the way to success, in this case, resolving the kata. Starting the day with an exercise like this definitely is a must, it’s almost better than a cup of coffee(But I prefer both, if possible).

Today I have started to exercise koans for the first time. A kōan (公案) is a story, dialogue, question, or statement, which is used in Zen practice to provoke the “great doubt” and test a student’s progress in Zen practice by wikipedia definition. This concept is also applicible for apprenticeship, especially while learning a new language. The process starts easy, like completing small mathematical operations, guessing the return type of the operation by the help of the hints. The best thing about koans is, each koan incrementally prepares the student for next koan. With this approach a student learns new things on each koan, and gets ready to be trained harder for next the time.

For Scala, I use Scala Koans and it also covers installation process and some “how to” information.