In computer programming, unreachable code is part of the source code of a program which can never be executed because there exists no control flow path to the code from the rest of the program.
Unreachable code is sometimes also called dead code, although dead code may also refer to code that is executed but has no effect on the output of a program.
Unreachable code is generally considered undesirable for a number of reasons, including:
- Occupies unnecessary memory
- Causes unnecessary caching of instructions into the CPU instruction cache - which also decreases data locality.
- From the perspective of program maintenance; time and effort may be spent maintaining and documenting a piece of code which is in fact unreachable, hence never executed.
Read more about Unreachable Code: Causes, Examples, Analysis
Famous quotes containing the word code:
“Acknowledge your will and speak to us all, This alone is what I will to be! Hang your own penal code up above you: we want to be its enforcers!”
—Friedrich Nietzsche (18441900)