>I'm not saying you can't do it that way. I prefer to declare them up top when needed. Variables needed just inside a loop or if get declared at the top, inside.
You made it clear - "most of the people..."; no confusion there. Was just thinking aloud as to why I don't think that's a healthy practice. If you are sure the variable will be so very local, then fine - I do that sometimes myself. But as a general habit, spreading declarations all over the place looks sloppy to me. Looks almost like my desk.
>>IMO, one neat thing about the variable declarations is that they're grouped on top, just like they once were in single-pass compilers, so when you need one you know where to look. You may scatter them throughout the code, but that decreases readability, IMO, and then you at least have to search up and down. Well, the more you read the code, the better you know it...