[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why are people so afraid of globals?
- From: Jim Jennings <jennings.durham.nc+lua@...>
- Date: Mon, 12 Jul 2010 10:01:33 -0400
Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> I still think the main problem is non-intended assignment to globals,
> which creates hard-to-find bugs.
Doesn't the approach taken by "strict.lua" solve this for those that
want to force globals to be declared (ok, assigned) at "top level"
before they can be used inside a smaller scope?
Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote
> Lua is a dynamic language with dynamic typing, and we do not intend to
> change that.
I'm glad to hear this, although I had no doubt it was true. A
sufficient number of "internal" features of Lua are exposed that users
can impose their own additional constraints (for their own code) in
order to permit certain kinds of static analysis. What more could one
want?
HyperHacker <hyperhacker@gmail.com> wrote:
> I think rules like "only if you used the keyword before" or "only
> within a function" are going to make things more confusing
I strongly agree. Orthogonality permits composability, and
composability has great value in a programming environment (language,
libraries, run-time). After all, programming itself is the act of
composing little statements and expressions into bigger pieces. The
best of the bigger pieces are likewise composable.
Jim