質問

I'm working on a medium sized (100k lines) code base, it's all relatively recent code (less than a year old) and has good unit test coverage.

I keep coming across methods which are either no longer used anywhere or only referenced in unit tests which only test that specific method.

Should I remove this code if I'm certain that it's no longer needed?

Reasons to remove it:

  • Less code, less bugs
  • Less code is easier for others to digest
  • It's still under source control

Reasons to keep it:

  • Can be used as reference
  • It may be useful sometime
  • It may have been written to 'round-out' the functionality for a class

正しい解決策はありません

ライセンス: CC-BY-SA帰属
所属していません softwareengineering.stackexchange
scroll top