It’s Kataday – the Gilded Rose kata

22 Oct 2022

Sometimes, rewriting and modernising code just isn't an option.  When this happens, refactoring is one of the best options.

James Mason, Software Craftsperson at Codurance, in his recent blog Refactor before you rewrite, looked at the benefits of refactoring.

Being able to enter a totally unknown area of code, understand it, work with it and extend it, is a valuable coding skill.

James recommended the Gilded Rose kata as a great way to practice refactoring.  

I wholeheartedly recommend spending some time working through the Gilded Rose kata using the approach described while making sure to stick strictly to the defined rules. It’s a great, if not slightly contrived example of refactoring legacy code.

You won’t fix everything that's wrong with this code and that's ok. After the most complex part of the system looks a little better, the rest becomes trivial. If after working through the kata, you are still not sold on the approach, try doing it again, but add the “conjured items” feature first. Which approach did you prefer?

The Gilded Rose kata is aimed at extending the skills of the competent developer focusing on Property Based Testing and Legacy Code.

Getting set up can be the roadblock to starting a kata. In our screenkatas you can join our Software Craftspeople and let them show you how to set up your repositories for JavaPHPPython and Typescript. For other languages, check out our guide on GitHub.

Love our #kataday challenges?  Then find them all here and don't forget that our Katalyst portal is filled with programming problems to expand and sharpen your coding skills.