But negative LOC alone is just as useless a metric as positive LOC. It's easy to come up with examples where deleting unused code is actually harmful:
- Just delete all comments
- Remove platform code you are not using now, but might in the future
- Remove reference code because you are only using platform code
- Remove test code that is just not called yet, but really should be
- Remove code from a copied library that is now harder to keep current
- etc..
This is definitely harmful, agreed.
Definitely. It's in the repo if you want to get it back, so there's no reason why unused code should be in your source.
Yes. Remove everything you're not using. It's in the repo.
And again. Remove it if it's not used. Or start using it. Nothing else is acceptable.
You should probably be pinning versions of libraries otherwise you're going to see things break in the future. Upgrading them is a feature.
Deleting comments aside, using negative LOC as a metric does encourage people to write better code.
But negative LOC alone is just as useless a metric as positive LOC. It's easy to come up with examples where deleting unused code is actually harmful:
- Just delete all comments
- Remove platform code you are not using now, but might in the future
- Remove reference code because you are only using platform code
- Remove test code that is just not called yet, but really should be
- Remove code from a copied library that is now harder to keep current
- etc..