3 ms·
This story is about how useless LOC is as a metric. But negative LOC alone is just as useless a metric as positive LOC. It's easy to come up with examples wher
by starmole 11y ago
This story is about how useless LOC is as a metric.
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..
- wldcordeiro 11y agoNegative LOC while retaining those things would be optimal, if you can manage to reduce the size of the overall codebase while fixing issues and/or adding features it's the best possible outcome.
- crististm 11y agoLOC is not useless since it's just a metric. It's interpretation is what matters.
- onion2k 11y ago- Just delete all comments This is definitely harmful, agreed. - Remove platform code you are not using now, but might in the future 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. - Remove reference code because you are only using platform code Yes. Remove everything you're not using. It's in the repo. - Remove test code that is just not called yet, but really should be And again. Remove it if it's not used. Or start using it. Nothing else is acceptable. - Remove code from a copied library that is now harder to keep current 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.