Variations of the Range kata by Mark Seemann
In the languages I usually employ.
The Range kata is succinct, bordering on the spartan in both description and requirements. To be honest, it's hardly the most inspiring kata available, and yet it may help showcase a few interesting points about software design in general. It's what it demonstrates about functors that makes it marginally interesting.
In this short article series I first cover a few incarnations of the kata in my usual programming languages, and then conclude by looking at range as a functor.
The article series contains the following articles:
- A Range kata implementation in Haskell
- A Range kata implementation in F#
- A Range kata implementation in C#
- Range as a functor
I didn't take the same approaches through all three exercises. An important point about doing katas is to learn something, and when you've done the kata once, you've already gained some knowledge that can't easily be unlearned. Thus, on the second, or third time through, it's only natural to apply that knowledge, but then try different tactics to solve the problem in a different way. That's what I did here, starting with Haskell, proceeding with F#, and concluding with C#.