lua-users home
lua-l archive

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


On Thu, Jul 1, 2010 at 23:25, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>>   slow addressing of global scope, thus you have to localize (reassign) about
>>   every function and structure you're using in single script...

> This perception is probably our (the community's) fault with its insistence
> on "performance". Lua is probably quite fast already even if you only use
> global variables, ie, don't bother with locals.

For the performance — perhaps.

However most of the arguments against using globals in other
programming languages are valid for Lua.

In addition, globals in Lua not live well with sandboxes.

So, one, probably, should bother with locals, but not for performance
reasons, but to keep code clean.

Alexander.