lua-users home
lua-l archive

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



On 18 Jun 2012, at 11:21, Patrick Masotta wrote:

I’m new to LUA but I have good programming experince..
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?
 
2) Why you guys do not use {} instead of the wordy BEGIN END sequences???
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
 
3) Why there’s not a switch statement?
 
Best
Pat

1) I agree this is weird. It's a bit of a PITA when walking over Lua and C arrays in parallel. It's more likely one of those philosophical decisions, that has nothing to do with technical requirements - but I could and probably am wrong. I'm sure this has been discussed many times before on this list, why don't you go and search through the archives.

2) Could ask that question of Ruby and Python (-end)… Um i'm not sure where you got the 'BEGIN' from there's only end. Personally I think the makes the code easier to read. I find myself fighting with those modern IDEs that autocomplete code. Also just on principle, if the process of adding brackets can be automated to that degree, it makes their use completely redundant and they should probably be removed from the language.

3) It's redundant. The Lua language strives to be small and clean. The lack of continue is annoying, but I believe this has been solved with goto in 5.2.

-Arran