Code Worrier

Teaching myself to RTFM

Passing Symbols, a Kata Lesson

| Comments

In my post about the kata gem, I promised to share something I learned from the calculator kata. Here goes.

The calculator kata asks you to construct a Calculator class the instances of which are initialized with comma-delimited strings of integers. Next you are asked, one by one, to create a series of instance methods—#sum, #prod, #div, #diff—for the class that perform arithmetic operations on the stored integers.

Starting with #sum only, I wrote the class, obviously enough, like this:

Code Kata and the Kata Gem

| Comments

A code kata is a small programming challenge on which a developer can practice her craft. Kata have solutions in the sense that they set our requirements that a program can meet or fail to meet. However, it is the process of thinking through the kata—and perhaps implementing it multiple times in different ways—that is intended to provoke learning.

Of course, you can’t learn anything form a kata unless you do the kata. Enter the kata gem by Wes Bailey.