• Subject: Re: 1-based indexing in Lua or the one without zero
• From: Oliver Kroth <oliver.kroth@...>
• Date: Tue, 24 Apr 2018 13:54:00 +0200

 Am 23.04.2018 um 18:58 schrieb Axel Kittenberger: > Related, about point three. When pacing (aloud) a distance I normally > see people step at the star and count "one, two, three...", no "start" > or "zero" "one, two, three", but that may be a local custom. If you want to index the positions, where you started, would that be "one step" or "zero steps"? I don't get it, why everybody is always talking about "counting". Again and again. Nobody is actually ever counting anything, especially data. I do count. My software does count. Even the computer isn't exactly "counting" if you query #array (dunno what the current implementation is, is it still look at the array part counter and then do a divide by half search on the hash part to find an "edge"?). Anyway, what's happening all the time is indexing and indexing only. There is no "counting" only addressing/indexing. What index the first (yes first item) should have, is the question. Am I the only one that feels that the N-th item should be found at position N? I don't like to get forced to put them elsewhere. Even the (bot so) good old BASIC did not forme me. A DIM A(10) command created an array A with 11 elements, leaving me the choice to not use A(0) or A(10). Does it have index 1 or index 0? I still wonder how the "it's all about counting cows and steps" people can leave with the fact the first year of a decade has a 0. That's so unnatural! There is no year 0. Neither BC nor AD there is a year 1 BC, and a year 1 AD. The first ten years (AD) are 1, ..., 10. The first century was 1,...,100 The second century was 101,...,200 The twentieth century was 1901,...,2000. After 1999 should come 2111, would be much more natural. Only if you represent the numbers using digits '1',...,'9' only. In that case '1' has the value 0, and '9' the value 8, and your numbering is 9-based. Don't mix up digits ans numbers. Digits are for numbers what characters are for words. -- Oliver