Do not use the same variable name in two scopes where one scope is contained in another. Examples include:
- No other variable should share the name of a global variable if the other value is in a subscope of the global variable.
- A block should not declare a variable with the same name as a variable declared in any block that contains it.
...
Reusing a variable name in a sub-scope subscope can lead to unintended values for the variable.
...