Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on What's New in Lua 5.4. Parent comment
("12345"):sub(3,3) returns "3", while ("12345"):sub(3,4) returns "34", and ("12345"):sub(3,2) returns "".
Indexing in the array portion of tables, and strings, is at least consistent; but Djikstra was right.
The Wiki[0] has a good discussion of Djikstra's iconic essay. The best of these arguments, imho: 0 based indexing unifies enumeration and measurement.
[0]: https://wiki.c2.com/?WhyNumberingShouldStartAtZero
There are no comments on this comment yet.
("12345"):sub(3,3) returns "3", while ("12345"):sub(3,4) returns "34", and ("12345"):sub(3,2) returns "".
Indexing in the array portion of tables, and strings, is at least consistent; but Djikstra was right.
The Wiki[0] has a good discussion of Djikstra's iconic essay. The best of these arguments, imho: 0 based indexing unifies enumeration and measurement.
[0]: https://wiki.c2.com/?WhyNumberingShouldStartAtZero