3 ms·
Finding all dead code would mean solving the halting problem, even in the simplified case when you're not writing a library whose consumers may no longer use an
by adrianN 9y ago
Finding all dead code would mean solving the halting problem, even in the simplified case when you're not writing a library whose consumers may no longer use an exposed function.
- pacaro 9y agoNow we're discussing the meaning of "dead code". I'm pretty certain that the OP was referring to methods that have no callsites. That doesn't require much in the way of proof, the git bisect seems to be more about identifying when it became dead. Now if you have methods that have existing callsites, but aren't being called, then yes, you may need to solve the halting problem to prove that no basis path that is actually followed calls the code in question. Of course in a dynamic language, or one with reflection, then the distinctions are blurry