Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Lua seems like such a fun, simple, efficient language... but even on HN, people hate on it almost to the point of an absurd meme simply because its 1-based indexes.

> If you search the forums, this fundamental issue is mentioned thousands of times over years and years.

> Which leads me to a naive question: Lua is open sourced. Why hasn't anyone in the world just forked the language to be 0-based? Is it not as simple as it sounds? I don't know what goes into designing and compiling a programming language, so it seems like such a trivial fix for what appears to be the #1 issue for every person out there allergic to Lua.

I wonder how many of those who complain have actually used Lua? Same with all the Perl/PHP haters...



Lua Rocks. (Yeah, I know...) One-based indexing is more natural, far, less error-prone, reflects real world relationships better (people starting at one, not zero) than zero-based indexing, which has become some kind of purity test for the worst sort of propeller-headed CompSci weenies.

Many other languages have chosen one-based indexing for the same reasons: all of them are languages that have a high incidence of dealing with real-worrd data and relationships: In addition to Lua (a beautifully elegant language) there's FORTRAN, Julia, Tcl, Awk, Mathematica, Matlab, COBOL, Smalltalk, and quite a few others. The architects of these languages made very deliberate decisions to prefer one-based indexing.

One-based indexing makes a LOT MORE sense for most real-world work, and as noted, avoids the ubiquitous off-by-one errors that pervade the unnatural zero-based indexing.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: