Refactoring is making code better. We all want to make things better. Making thing better makes us feel good.
We watched Therapeutic Refactoring by Katrina Owen to see what pointers she could give about making things better. Turns out, quite a few. She tells a story about a horrible block of code from an untested segment of a legacy application.
Legacy applications are talked about by programmers with a mix of anxiety and apprehension. If a legacy application has no tests you never know if a change you made just broke something you haven't noticed. At Resolve when we pick up a client with an existing codebase there's a chance it will be one of those legacy applications with no tests.
Fortunately, Katrina lays out, step by step, how to add tests to a legacy application that will tell you what the application currently does. Once you have these not only can you develop new features without fear, you can start refactoring!
Katrina walks through refactoring her example code. She finished the story by discusses removing "codejunk," bits of code that don't do anything and make it hard to understand what other code does. Next comes the moral of the story, why refactoring makes us feel good; it gives us back our brains and stops us panicking. When we aren't panicking we write better code for the future.
Refactoring makes existing and future code better, clearly a good programming and business practice.
Join The Conversation
More On The Blog
Investing in Digital Marketing in 2021.
In such a competitive environment, the need to increase your online visibility and optimize your site’s conversion rate often demands an investment in digital marketing tactics.
Alejandra Renteria — Jun 16, 2021
3 reasons your website still doesn't work on mobile
More than complying with Google, we believe that setting up your mobile site correctly is key for sites. From ranking higher, to optimizing performance and customer experiences, sites will undoubtedly work better when optimized for mobile from the ground up.
Alejandra Renteria — Jun 3, 2021
Why is it so hard to get an estimate for a software product?
Getting an accurate estimation for your software product can save you time, money and countless headaches when building your site, MVP or product.
David Hemmat — May 20, 2021