Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Code that is never executed is known as dead code. Typically, the presence of dead code indicates that a logic error has occurred as a result of changes to a program or the program's environment. Dead code is usually optimized out of a program during compilation. However, to improve readability and ensure that logic errors are resolved, dead code should be identified, understood, and eliminated.

Wiki MarkupFor a related recommendation, please see \[[This recommendation is related to MSC12-A. Detect and remove code that has no effect]\].

Non-Compliant Code Example

...