WHAT WENT DOWN
The kata for the night was "Roman Numerals", implementing a parser which could convert "modern" Roman numerals into their actual Arabic number. The important rule was that only 1 smaller numeral could precede a larger one. Hence IV is valid as 4 but IIV isn't valid for trying to represent 3.
Overall it was a really interesting and education evening! I paired with Mani for two pomodoros and Damien for the last one, code up here: https://github.com/arkangelofkaos/CodeDojo25_RomanNumerals
The kata for the night was "Roman Numerals", implementing a parser which could convert "modern" Roman numerals into their actual Arabic number. The important rule was that only 1 smaller numeral could precede a larger one. Hence IV is valid as 4 but IIV isn't valid for trying to represent 3.
Overall it was a really interesting and education evening! I paired with Mani for two pomodoros and Damien for the last one, code up here: https://github.com/arkangelofkaos/CodeDojo25_RomanNumerals
Overall it was a really interesting and education evening! I paired with Mani for two pomodoros and Damien for the last one, code up here: https://github.com/arkangelofkaos/CodeDojo25_RomanNumerals
MY IMPRESSIONS
Go slow to go fast
When doing TDD, going slowly can help you avoid edge cases later. When we came to implementing "subtracting" numerals, like what you have in IV, Mani pointed out it was "a jump too far". We hadn't implemented V yet and the code could do with a refactor once it was. Overall I think doing the two steps was faster and safer than doing it all in one step.
Tests are code as well!
This is a mantra to follow and appreciate. Our test cases could really have benefitted from using parameterised tests. <LINK?> Learning to use this and keeping to it is definitely a goal for me now :)
No comments:
Post a Comment