+ 1
Variable shadowing
If nested loops can have the same variable names but different scopes, is this not a design flaw ? eg) C++, C#. Is there not a language where this is addresed?
1 Odpowiedź
+ 2
No, it leaves it up to the programmer to make that mistake. If you need to use multiple variables in a nested loop you'd never name them the same. If not, then it's no big deal.