Variable Shadowing
Noun · Development
Definitions
The situation where a variable declared in an inner scope has the same name as one in an outer scope, effectively hiding the outer variable within that block. Some languages like Rust embrace shadowing idiomatically (e.g., re-binding after a type conversion), while others like C# forbid it to prevent confusion.
In plain English: When a new variable with the same name as an existing one is created in a smaller section of code, temporarily hiding the original.
Example: "In Rust I shadow the input string with its parsed integer — same name, different type, no mutability needed."