Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Why numbering should start at zero (1982). Parent comment
For 0 based indexing the punctuation is the indexes/offsets:
[ a , b , c ] 0 1 2 3
[ a , b , c ] 1 2 3
elements[0:3] - all items between offset 0 and 3
elements[1:3] - all items including 1 and 3
Where they stop making sense is when you'd mix up the inclusivity ie (for the second case).
elements[1:4] - including item 1 not including 4
There are no comments on this comment yet.
For 0 based indexing the punctuation is the indexes/offsets:
for 1 based indexing consider the actual elements are the indexes/positions: In the first case it is non inclusive, ie. The second case is inclusive, ie. Personally I don't have an issue with either, they both 'make sense'Where they stop making sense is when you'd mix up the inclusivity ie (for the second case).