lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> My observation from Lightroom was that that wasn't our primary
> concern, so I've been a bit puzzled. (Our concern much more centered
> around reading or writing something that isn't what you meant to
> because you spelled it wrong -- for a generous use of the term "spell"
> that also includes getting the terminology or naming wrong.)

I think "misspelling" is a big problem, but one that is inherent to
dynamic languages. And one that usually is not difficult to spot with
good testing.


> Could the inadvertent writes to globals issue be more accurately
> described as avoiding creating code that isn't re-entrant, doesn't
> cooperate well, etc because of the use of globals where locals would
> have done perfectly well? Or are there other issues to be prevented by
> targeting writes but not reads?

If you read a global that should be a local, there are two options:
1) you are reading the wrong variable: then the error is probably
misspelling;
2) you are reading the right variable: then the original error was when
creating the variable, not when reading it.

For me, the main point is debugging. The main problem with inadvertent
writes to globals is not that it is a very frequent error, but that it
is a reasonable frequent error that is hard to find.

-- Roberto