Toying with the halting problem is fun, but all it really shows here is that you can't infallibly figure out if code is dead, because that means solving the halting problem. Of course, there are tons of ways you can figure out dead code: both statically (say, code after some code that you can prove unconditionally returns or raises) and dynamically (if during six months of operation no-one has called a piece of code, it probably might as well be gone).
1 comment
[ 2.4 ms ] story [ 16.0 ms ] thread