Dead code: Difference between revisions

Content deleted Content added
No edit summary
Fixed subject-pronoun agreement, removed "... indeed, it is"
Line 3:
The presence of dead code may reveal either logical errors due to alterations in the program or significant changes in the assumptions and environment of the program (see also [[software rot]]); a good compiler should report dead code so a maintainer can think about what it means. Many times dead code is inserted by a defensive programmer as [[Assertion Code]] for tests that really can't happen (yet). Other times dead code is inserted by the programmer for debugging purposes but has yet to be removed.
 
Before removing apparently 'dead' code, a programmer must satisfybe themselvessatisfied that it really is dead. This is easyeasier on short pieces but more difficult on long sections where the function it performs is not clear... indeed, it is by definition performing no function it is hard to prove a negative. Thus much dead code remains and its removal by the compiler is important.
 
{{Compu-stub}}