Variations of the Range kata
source link: https://blog.ploeh.dk/2024/01/01/variations-of-the-range-kata/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
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#.
Wish to comment?
Recommend
-
62
README.md
-
32
Rethinking the n queens problem for SQL This is a version of the classic n queens problem (https://en.wikipedia.org/w...
-
10
What we learned from leading a TDD Code Kata lunch and learn I’ve been wanting to try out a code kata for a long time. I’ve also been wanting to get better at Test Driven Development (TDD). I decide...
-
10
The Maître d' kata by Mark Seemann A programming kata. I recently wrote about doing programming katas. You can find k...
-
6
String Calculator Kata in F# - happy endOur calculator works pretty well so far. We were also able to use a few functional techniques in the process. Railway programming and composition is one of them. This is a second part of...
-
7
10 lessons learnt from the Ruby Refactoring Kata - Tennis Game Over the last ~2 months, I’ve been scheduling some time to work on a specific Ruby code which is designed to be a good starting point for a refactoring. Those...
-
13
0:00 / 26:40 ...
-
5
A Range kata implementation in Haskell by Mark Seemann A first crack at the exercise. This article is an instalment in
-
4
A Range kata implementation in C# by Mark Seemann A port of the corresponding F# code. This article is an instalment in
-
1
A Range kata implementation in F# by Mark Seemann This time with some property-based testing. This article is an instalment in
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK