What is ‘variable shadowing’ and why it should be avoided.
Before we go straight to the definition, it is important to observe that a more comprehensive understanding of variable shadowing requires knowledge of two other fundamental programming concepts. Firstly, the importance of naming variables and, secondly, local variables and scoping rules.