Coding Dojo #3: Krypton Factor
We ran our 3rd coding dojo on Thursday night, attempting to solve the Krypton Factor problem from the Online Judge website.
The Format
What We Learnt
-
We still ended up spending a large percentage of the time drawing out the problem on the whiteboard and not coding. This seemed partly due to the difficulty of the problem and partly due to the layout of the room whereby the pair coding were sitting at the back and the people watching were sitting in front of them. We are going to try changing the layout so the pair at the computer are at the front of the room to shift the focus to the code.
-
The problem we picked was very algorithmic in nature and we spent a lot of time discussing how to write an optimal solution to it rather than getting a naive one working first. It was eerily similar to the situation we sometimes end up with on projects where we are prematurely optimising a system before we actually have it working.
-
The previous two coding dojos we had focused on a problem which was easier to understand and perhaps more suited to a TDD and Object Oriented approach. We are probably going to try and focus more on problems which we can understand more quickly therefore allowing us to focus more on the way that we solve them.
-
One thing I learned personally when pairing with Phil was the need for clear naming of classes and methods. We had let this slip a bit as we struggled to progress with the problem to the point where the naming we had didn’t really make any sense. When Phil came to the keyboard he pointed this out and we refactored the code until it made more sense.
-
A common trend across the three coding dojos we have run so far is that we are always working with a very high level problem and struggle to break it down into smaller chunks that we could work on. It was suggested that perhaps breaking down the problem into stories might be more effective since this is what we are used to from our project work. We have often ended up with classes have a lot more than one responsibility due to our attempts to solve the problem from the first acceptance test that we write. Writing stories would help in our attempts to take baby steps on the way to solving the problem.
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.