Just a reminder on refactoring: it means finding parts of the code where it can be improved in quality.
Also, as style of code must be consistent across whole code base, I should also apply the refactoring in all similar places that need to be refactored the same way.
Refactor the system back.. backfactor.
I see 2 reasons “why not to”:
- one can’t
- one has no time
I will try to argue both.
1. Sure you can. Maybe you have no way to know if code after modification works the same way as before. Well, you probably have no tests, or your code was already way too complicated. Either way – you need to find a solution, and find it quick
2. No time. This is tricky. As I believe leaving such code creates legacy code. Creates inconsistency among code base. And in the end more time is wasted than spent on backfactoring.
Any new (or you) developer reading system code in future, will find the same problems solved in different ways, or expressed in different ways. They will need to spend more time than you would backfactoring earlier..
Hope it makes you thinking when you refactor next time :-)