Hacker News new | ask | show | jobs
by xxpor 2208 days ago
I get what you're saying, but to be more general I'd argue that's just 0 indexing with the API specifying what's in what index.

I'd more "formally" define 0/1 indexing as:

Zero indexing: arr[0] is a valid way to address the first element of an array, and len(arr) - 1 is the index to the final element.

One indexing: arr[0] results in an error or an out of bounds access, and len(arr) is the index to the final element.

These statements are true in Matlab, but not most command line tools.