Abstract: Like everyone else, you have a large product that is hard to work with. We're going to change that in 75 minutes. Together we will save some gnarly legacy code (one thousand-line function). We will start with something hard to read, untested, and possibly buggy. We will finish with code that is stupidly easy to modify. You'll learn 6 trivial techniques that you can apply over and over to fix 95% of the messiest code you have. You can take home this exercise to help the rest of your team learn these techniques. You'll also learn how your team can teach itself a bunch more techniques to handle the other 5%.
We are going to save some legacy code. In 75 minutes. While adding features. We will mob program; you will save this legacy code. We won't introduce any bugs along the way. We will spend the time that you would normally use reading code to instead make it readable. You can apply these techniques and reduce the cost of coding within 48 hours of getting home.
We have done this exercise with dozens of teams. They code differently now. Changing existing code is actually safer and cheaper than writing new code. Their designs get a little better each day. This session will improve your code and show you what skills to learn to gain further improvements.
Learning Outcomes: - Know the 6 refactorings required for reading code by refactoring it.
- Differentiate between refactoring and micro-rewrites (code editing), and choose each where appropriate.
- Have fluency in the key refactorings with one tool set and know how to spread that fluency to other tools and to broaden the skills within that tool set.
- Able to start successfully saving legacy code without making major investments, even with no tests.
- See an obvious path for continuing to learn design and refactoring skills - know where and how to get feedback and can create own curriculum for next 1.5-3 years of improvements.