That's a good rule. I usually declare variables as close to their intended scope of use as I can get them, so for instance, right inside the block where the variable is going to be used.
The temptation then becomes to re-use the name but I avoid that to make it easier to see which declaration belongs to which variable.
Declaring all the variables at the top of a function was a pretty hard to break habit.