lua-users home
lua-l archive

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


Am 12.12.2012 11:55, schrieb Dirk Laurie:

[...]

Anyway, the point of Thijs's question is not so much about global
versus local.  It is about conventions for certain names.  For example,
if I start up some script that preloads some stuff, and I see a Lua
prompt, would it not be nice if there is a good chance that typing `help()`
or `=help` does something helpful, and even better if we could agree
which?  I don't really care whether names like `lfs` and `lpeg` have
been declared local or global by the time I get in. But I would strongly
object if `lpeg` is defined but actually means "linear programming example
generator".

I wouldn't if "lpeg" was an established acronym or name in the program's domain and the LPeg library wasn't used in the same program. I'm pretty confident that I can recognize LPeg code when I see it, so no harm is done.


What we should be compiling is a sort of conventional glossary, with
a broad consensus that any name in that glossary should either be used
in an accepted sense or not used at all.

Or are Lua programmers just too individualistic for this ever to work?


If you are serious about this, I suggest we start by listing actual occurrences of common names used for different things and the amount of extra time spent to understand the code, and compare those to the time used by the programmers consulting the glossary for every new variable definition. This way we might get a list that actually saves time and energy.

My guess is that this list would be very short, but I'll be happy to be convinced otherwise.

Philipp