Coding Dojo #4: Roman Numerals
We ran our 4th coding dojo on Thursday night, attempting to solve the Roman Numerals problem from the TDD Problems website.
The Format
We ran with the Randori approach again with between 4-6 participants taking part. We coded for about an hour and a half.
The pair coding were sat at the front of the room this time in an attempt to keep the focus on the code, a problem identified last week.
What We Learnt
-
I had worked on this problem myself a couple of weeks ago but it was interesting to note how many more of the edge cases we managed to cover when working as a group. We had an discussion around where the validation of what constitutes a valid roman numeral should go. We ended up validating when the roman numeral object was converted into an integer, the other option being to do constructor validation. I’m not sure exactly when each approach is applicable - I would tend to do constructor validation when data is coming in from the user interface otherwise validating when the object is used.
-
Having the pair at sit at the front of the room worked much better in terms of stopping others drawing on the white board and we seemed to achieve greater focus on the problem than in the previous weeks although I’m not sure whether or not this is directly linked to the positioning of the coding pair.
-
The idea of keeping minimal state in the code was an interesting idea that was suggested early on and one which we kept to. I’ve not considered this as part of my approach to solving problems before but it makes sense in helping to drive simplicity of design.
-
The drive for the green bar was again in evidence - on one occasion I tried to refactor and make the test pass in one go, forgetting that this would keep us away from the green bar for longer. This was pointed out by my pair and I backtracked the refactoring and just made the bar green.
About the author
I'm currently working on short form content at ClickHouse. I publish short 5 minute videos showing how to solve data problems on YouTube @LearnDataWithMark. I previously worked on graph analytics at Neo4j, where I also co-authored the O'Reilly Graph Algorithms Book with Amy Hodler.