After months of development, one of your developers refactors a piece of code to be much better than before. In many cases, you end up with code that is no longer in use. Some people say Keep it around in case I need it but I say Delete it
At first, this may seem counter-intuitive. Isn’t this gong to cause more work in case you do need that function? No. Delete it. Don’t think twice. Here is why.
Unused code isn’t being tested. Used code is tested everyday, by your users if nothing else. The last thing you want is a developer to use code that might be completely wrong.
It reduces your code base. The less code you have, the less probability for problems exist. The less code you have, the easier it is to learn the code base.
Lastly, your developers should be learning everyday. If given a second chance, many developers would develop the same function completely differently a year apart. They would code a better function, that is more thoroughly tested and uses best practices.
So, don’t worry about it. Delete it.