Dan Bracuk wrote:
> What is the perceived advantage of creating a local
structure and plopping all
> your local variables into it? To me it looks like extra
work because you then
> have to type the structure name whenever you use the
variable.
I'm with you Dan. I've never felt this was much of a problem
that
needed solving. But the world takes all kinds to make it go
around, so
if this makes one feel good, I also see no harm in it.
The one *tiny* benefit, as I understand it, is that if you
are
consistent in appending all your variables to the 'local' or
'ian' or
whatever structure you don't over look a variable and forget
to var
scope it. This could, possible, I guess, be beneficial for
simple,
throw away variables like loop counters and such.
Personally I like var scoping all my variables at the
beginning of the
function. It is a convenient exercise that also reminds me to
initialize any that need initialization and to document the
purpose of
each one.