Kata: C** de chouette - conclusion
It is time to write a conclusion of our made-up coding kata based on a dices game called Cul de chouette.
It has kept us busy for the last month, see the following previous logs:
- C** de chouette
- C** de chouette - multi-players
- C** de chouette - modes
- C** de chouette - sequence
- C** de chouette - refactoring and last rules
My goal was to start designing on a totally unknown kata to challenge my skills.
Few years ago, I was mentoring someone who, during a pair programming session, told me: "it's easy for you, you already have the design in mind".
It was uncomfortably true, even though, not totally accurate, I often have an idea of the design, sometime really precise, but that's never the one I end up doing.
This time, I wanted to work on something I did not know, so I would not have this bias.
The other difficulty is to prevent anticipation: I have worked in many fields (security, scientific, industry companies, etc.), so I tend to anticipate the next step, it is why take an absurd fictional game was a good move.
Also, it was fun!
Starting with the hard numbers, our final implementation has:
- 10 data-types, 9 type wrappers, 2 type aliases
- 22 functions
- 159 tests
- 547 line of codes (217 for tests, ~40%)
It it mostly a medium module, which is an average "well-designed" module.
Regarding my impressions: I'm glad I did it.
I had a bit of nostalgia regarding Kaamelott (the originating tv series), and I wanted to do it since a long time.
I'm always amazed that the simplest techniques (starting with a function and few well-structured types) can go a long way.
It gives a simple stem to build onto, starting on a new one when the cost of adding features increase sharply.
Finalizing the whole implementation on a big composition.
It was also great to start without plan, my intuition it that, with a plan or goal in mind, I would have forced a single function to grow to handle all the cases.
Instead, I have carefully break down the functions, not know how they would be used, and they ended up composing.