News for hackers. Stuff that matters.
Re:How to make a game from scratch using Lua and Löve by grzm on Sunday February 18, 2018 @12:27AM (#16404608)
While many languages follow a 0-indexed convention, as you see here, not all do. Another couple of cases I run into are Postgres arrays, and switching between “first”, “second”, and “nth” in Clojure.

If it helps, you can think 0-indexed as referring to the offset, and 1-indexed as referring to the position. It’s a shame to dismiss the entire language due to what one might argue is a minor aspect.

Re:How to make a game from scratch using Lua and Löve by synthc on Sunday February 18, 2018 @09:03AM (#16406108)
I would not call Clojure 1-indexed though because of 'first', it uses 0-indexing for list, vectors, and arrays.
Re:How to make a game from scratch using Lua and Löve by grzm on Sunday February 18, 2018 @09:29AM (#16406206)
To be clear, I’m not calling Clojure 1-indexed: I provided “nth” and “first” as examples of contrasting 0- and 1-based conventions; in this case within the same language.
Re:How to make a game from scratch using Lua and Löve by runevault on Sunday February 18, 2018 @01:09AM (#16404727)
Clojure being a lisp also has different enough syntax it is easier to jump back and forth because you're doing way more context switching. Lua looks enough like other c-style languages you can forget it is 1 based and make all sorts of nasty mistakes.

You can certainly argue it is unfair, but it is still something that increases the risk of mistakes.

Re:How to make a game from scratch using Lua and Löve by setzer22 on Sunday February 18, 2018 @04:41AM (#16405224)
Replacing (first coll) by (nth 1 coll) in clojure happens to me more often than I'd like to admit