>Because they're indexes, not offsets from a base pointer.
There a lot of positive things when a language makes the index=base pointer mostly when the language want to live in good terms with C/C++
>Readability for non-programmers. Anybody with a half-decent text editor >will notice no difference in terms of effort to type.
I see, a programming language for non programmers... well I think is time for LUA reviewing this, mostly if the programmer comunity ever becomes the target of LUA...
Anyway, if you are a programmer you should understand that typing is not where the real effort is located... reviewing the code, understanding what you did one week, one month or one year ago, is where the real effort is really located....
Pat
--- On Mon, 6/18/12, Rob Kendrick <rjek@rjek.com> wrote:
From: Rob Kendrick <rjek@rjek.com> Subject: Re: LUA oddities.. To: lua-l@lists.lua.org Date: Monday, June 18, 2012, 3:33 AM
On Mon, Jun 18, 2012 at 02:21:57AM -0700, Patrick Masotta wrote: > I’m new to LUA but I have good programming experince..
Lua is not an acronym :)
> 1) I couldn’t believe when I saw LUA arrays indexed from “1”; that’s for kids not for programmers. > LUA is developed in C, there’s a lot of effort going on integrating LUA with C/C++ then why this?
Because they're indexes, not offsets from a base pointer.
> 2) Why you guys do not use {} instead of the wordy BEGIN END sequences???
Readability for non-programmers. Anybody with a half-decent text editor will notice no difference in terms of effort to type.
> No matter that modern IDE’s auto-completion save us the extra work punching more characters, The real problem is when we have to read LUA code instead; The bloated text makes harder to understand the code lay-out
Hardly. The
structure/indentation of your code has no relation to what is used to communicate to the parser that structure. Look at Python for example, which doesn't have any.
> 3) Why there’s not a switch statement?
Because there's a more powerful alternative: tables with functions in them.
B.
|