News for hackers. Stuff that matters.
Re:Lua Doesn't Suck – Strange Loop 2010 20-minute talk video by tryp on Sunday October 17, 2010 @06:42AM (#1800072)
I found that adopting the native idioms meant never having to notice the 1- based indexing. Everything is a hash table, and if you find yourself using literal numeric keys, there's probably a nicer way to do it.

The lua users wiki is full of interesting ideas for tackling the basics in ways that leverage lua's simple flexibility.

Re:Lua Doesn't Suck – Strange Loop 2010 20-minute talk video by pederb72 on Sunday October 17, 2010 @11:50AM (#1800585)
Actually, Lua's table object is split into two parts. The array part, which is accessed using numerical indices, and the dictionary. It's done like that to enable fast array access, and I do find it an incredible useful feature in Lua.

In my experience 1-based indexing is not a problem when you're just writing Lua code. I've sometimes been frustrated when creating Lua bindings to C-modules which involved some kind of array access though.

Re:Lua Doesn't Suck – Strange Loop 2010 20-minute talk video by __david__ on Sunday October 17, 2010 @06:52AM (#1800084)
That is entirely possible. I can tell if someone doesn't know perl or python because they write for loops like a C coder instead of looping over containers. So I can believe that you don't come in contact with that detail very often.

It just bugs me that such an obvious wart exists in an otherwise very clean language.

Re:Lua Doesn't Suck – Strange Loop 2010 20-minute talk video by silentbicycle on Sunday October 17, 2010 @10:15AM (#1800360)
The reason the arrays index from 1 is that Lua is designed to pare down to a data description & configuration language for non-programmers, and they felt that starting arrays from zero would be confusing. I don't like it it either, but in practice it's a minor issue.

People who write off Lua because of indexing from 1, Python because of the significant whitespace, Lisp for its pares, etc. probably haven't gotten to the really interesting stuff yet.

Re:Lua Doesn't Suck – Strange Loop 2010 20-minute talk video by stcredzero on Sunday October 17, 2010 @09:19AM (#1800236)
Where "obvious" = something only someone with a foreign viewpoint thinks about.

("foreign" with regards to programming language.)