lua-users home
lua-l archive

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


On Thu, Jul 1, 2010 at 15:18, liam mail <liam.list@googlemail.com> wrote:
> If I were to be totally honest the thing which I dislike most about Lua is
> the keyword 'local', I dislike typing it over and over again and that the
> fact the default scope is global. Having edited third party code, it also
> seems to encourage the use of the globals although this is not to say that
> the same authors would have used scoped variables in other languages.
>
> Liam
>

I agree, defaulting to global scope is one thing that always irks me
in Lua. It's easy to define a local variable in some module function,
then later delete the definition but neglect to delete an assignment -
now it's a global variable that suddenly appears, causing potential
confusion. Not to mention inexperienced/lazy programmers making
everything global because they don't realize/forget/don't care that
they need to specify otherwise, thus polluting the global namespace.

I'm sure it has some advantages, but they're escaping me at the moment.

-- 
Sent from my toaster.