Refactor Lessons Learned From The Bowling Game Kata (1/2)
The key to success in software development is the ability to advance in small steps. That can be small deliveries, small stories, and small changes. Instead of developing a zillion lines of code and, once finished, running it and seeing that it is full of bugs, and some behavior is not as expected, we can shrink and check quality at every step. One of the key abilities to do so is the ability to make small and incremental refactors. And the Bowling Game Kata presents one of the best techniques to do the smallest refactors possible. Distilling it into its essence.
This article seeks to teach some techniques to facilitate the refactor shown in the previous article:
The Emotional and Technical Guide to Rescue Stalled Software
When code gets complex, it’s not just about technique, but also mental preparation. Get ready to overcome your own…
Why Bowling Game Kata?
Something weird about the Bowling Game Kata is that it is not a kata like the others. Often, when someone talks about a kata, we understand a small problem that we have to solve. Instead, Robert C. Martin looks for the original name of the word, an exercise that you have to copy step by step, so you can learn until the smallest detail. Or as Robert C. Martin says:
“If you want to lean to think the way I think, to design the way I design, then you must learn to react to minutia the way I react.” — Robert C. Martin
That means that the bowling kata is a list of steps that we must follow verbatim. There is no room for improvisation, not even room to think our own solution, we just copy it. And that gives a unique perspective.
Instead of trying to figure out our own solutions, we can leverage on the big immense experience of Robert C. Martin, and their colleagues, the creators of TDD themselves, and discover very effective ways to refactor.