We have 5099 guests and 6 members online

Video Spotlight

Home > Blogs > Featured Blogs > Plan and Deliver > Refactoring Doesn’t Mean Rewrite

Refactoring Doesn’t Mean Rewrite

Written by Peter Schuh   
Tuesday, 10 March 2009 13:28

“You keep using that word. I do not think it means what you think it means.”

-Inigo Montoya from The Princess Bride

It is not a good thing that use of the term refactoring has grown so common. I cringe every time I hear a business person say the word.

Refactoring is meant to be one skill of many that is second-nature to a journeyman programmer. While doing other work, the programmer chooses not to ignore rough patches or unnecessary complication within method-level bits of code. Instead, the programmer pauses to sweep up and simplify, leaving the code cleaner than when he started. Interfaces are not altered. Outward behavior does not change. The benefit is forward-looking - since cleaner, simpler code that does the same thing is easier to maintain and build upon. As a craft, refactoring is meant to go unnoticed (although not unappreciated) by the business and the end user.

A rewrite is just what it sounds like. When the system can’t scale to satisfy peak loads, or the user interface is clunky, or interfaces to external systems are bug-ridden and obtuse, we need to consider a rewrite of portions or all of the code. We need to get permission from the business. Sometimes, we need the user to buy into the investment of migrating from one system or UI paradigm to another. We need funding. Every time I hear a business person (or, so much worse, a developer) say we need to refactor some part of the system to fix an issue or inefficiency, another hair follicle leaps from the top of my head and embeds itself in the side of my ear.

Why do I care? It’s just semantics. Well … it’s only semantics until someone gets hurt. Rewriting code is a risky and sometimes painful endeavor. It doesn’t always end well. If we execute a rewrite but call it a refactor and the whole thing goes pear-shaped, no business person is going to stop and think about semantics. They’re just going to cringe the next time they hear the word refactor. And when a journeyman programmer comes along and someone lets it slip that the programmer has been refactoring code without telling anyone - it’s going to cause all sorts of unnecessary confusion and consternation.

The business will believe programmers are taking prioritization decisions into their own hands. They’ll think that risks are being taken by a team of “cowboys” who cannot follow disciplined programming practices. And they’ll be justified in thinking that, because we could not keep our terms straight.

Refactoring Doesn’t Mean Rewrite

Read Full Article
Author:Peter Schuh

Comments (0)Add Comment


Write comment

You must be logged in to post a comment. Please register if you do not have an account yet.

busy
 

Agile Marketplace - Announcements and Special Offers

Webcast:  Moving Build and Code Quality Upstream
This interactive panel discussion moderated by Bob Aiello, Editor-in-Chief fo the CM Journal brings industry experts Anders Wallgren, CTO of Electric Cloud and Gwyn Fisher, CTO of Klocwork together for a candid discussion of the cost savings, productivity and quality benefits that can be achieved by stabilizing builds and code quality as early in the development cycle as possible.
Register Now!

Collabnet -TeamForge 5.3
CollabNet TeamForge 5.3 includes Dynamic Planning—providing flexibility to model release scope and timeline in a single view. Now, you can easily manipulate/adjust release data.
Download Your Free Trial

Requirements-based testing (RBT) can help to ensure comprehensive test coverage, reducing the risk of failure and improving software quality. This white paper details how application lifecycle management can be used to more effectively implement RBT processes, offering greater collaboration, traceability and control.can help you increase efficiency, reduce project risk, and improve overall software quality. Learn how MKS Integrity for application lifecycle management enables RBT, delivering full lifecycle traceability to help ensure that project requirements have complete test planning and execution coverage.
Download the Requirements-Based Testing whitepaper

PureCM –SCM for Agile Teams
PureCM helps you to manage development in short iterations: keeping track of changes, supporting automated builds and preserving frequent snapshots of your projects.
Get the free trial now