We’ve all been there – a product feature is called “gold”, and then a week before launch they decide it is to be called “platinum”. Luckily, you had some nous about you so the UI code is easy to change.
But…what about all the variables and methods? Sure, you could change all these but what about the testing time?
Obviously Resharper or some other enterprise level refactoring tool may help but how do you sell a zero-value proposition to the business? After all, that text change on the front screen is just a 2 minute job – right?
4
In this case I’d use a simple text search to find references to “gold”, then use a refactor tool to rename the variables and methods. After that, running the test suite should confirm that there’s no issues.
If renaming variables or methods causes issues, you should look at your workflow and find out why it’s a problem. If it’s very problematic, you could rename the method to the new name, then add a new method under the old name that just passes execution through to the new one, but is marked as deprecated.
Another option would be to add some notes to a general README or wiki, or whatever tool you use for knowledge sharing, and then as people work on different sections, they could rename them piecemeal
1
Don’t materialize business plans in code.
Every program that has a real lifecycle will have the problem you’re describing. The only way to deal with it is to say “that is not an issue in the code“, and to ignore it. Instead of having “gold”, “silver”, and “bronze” levels and dealing with the rename of “gold” to “platinum” and the insertion of “bismuth” below bronze, have “level 3.0”, “level 2.0”, and “level 1.0” and change 3.0’s name to “platinum” in the metadata (typically in a database) and insert “level 0.9”. Or if you prefer integers, count by 1000s – that’s plenty of room for insertion and range.
Heck, I once worked on a project where the product name changed so often it was known all through the technical side of the company as “&V2”, because that was the substitution symbol we used in the architectural documentation.
2