I am reading Stroustrup's book and he recommends we keep variables used inside loops, only inside the scope of the loop. This is easy to do for one variable but for more variables there are more options to do it, but I am not sure is it worth it. Do you guys bother with this at all?
For example:
for (double d; is >> d;) {}
it is better to keep the variable d inside the loop scope rather than do this:
double d;
for (;is >> d;) {}