I always have to consciously adjust for off-by-one errors, so this sounded appealing at first. (In the same way that Tau is appealing.)
However, after a bit of thought, I’m unable to come up with an example where this would help. Usually, the issue is that the 7th thru 10th seats aren’t actually 10-7=3 seats, but 4 seats. (the 7th, 8th, 9th, and 10th seats).
Calling them the 6th thru 9th seats doesn’t solve this. Can someone give an example of what it does solve, outside of timekeeping? (i.e., anything that counting time in beats wouldn’t solve?)
The first ten things have one-digit numbers, except the last one which has a two-digit number.
The second ten things have numbers starting with 1, except the last one which starts with 2.
The first thing in the first ten things has number 01, so “first” means simultaneously 0 and 1.
All of those go away with zero-based counting.
Also zero-based counting has many benefits for programming:
The first memory address is all zeroes, not 00000001.
The first grid cell originates at (0, 0), not (1, 1).
The idioms a[i / n], a[i % n], a[i * n + j] don’t work as well with one-based counting.
I think the underlying reason for all of those is the way modular arithmetic works. If a and b are positive integers, then the possible results of both a / b (integer division) and a % b (modulus) range from 0 rather than 1. Since digits in a number, indices in a sequence, etc. are often defined by these operations, zero-based counting feels more natural.
As to your problem, it can be solved by consistently using half-open ranges, which is another good idea that works well with mine :-)
The main examples to me are timekeeping, modular arithmetic, and memory addressing. The first moment of time, the first modulus and the first memory address are all 0. It seems harder to come up with natural examples where the first something is 1.
Your problem would be solved by using half-open ranges everywhere, which is another good idea that works well with mine.
I always have to consciously adjust for off-by-one errors, so this sounded appealing at first. (In the same way that Tau is appealing.)
However, after a bit of thought, I’m unable to come up with an example where this would help. Usually, the issue is that the 7th thru 10th seats aren’t actually 10-7=3 seats, but 4 seats. (the 7th, 8th, 9th, and 10th seats).
Calling them the 6th thru 9th seats doesn’t solve this. Can someone give an example of what it does solve, outside of timekeeping? (i.e., anything that counting time in beats wouldn’t solve?)
Some inconsistencies with one-based counting:
The first ten things have one-digit numbers, except the last one which has a two-digit number.
The second ten things have numbers starting with 1, except the last one which starts with 2.
The first thing in the first ten things has number 01, so “first” means simultaneously 0 and 1.
All of those go away with zero-based counting.
Also zero-based counting has many benefits for programming:
The first memory address is all zeroes, not 00000001.
The first grid cell originates at (0, 0), not (1, 1).
The idioms a[i / n], a[i % n], a[i * n + j] don’t work as well with one-based counting.
I think the underlying reason for all of those is the way modular arithmetic works. If a and b are positive integers, then the possible results of both a / b (integer division) and a % b (modulus) range from 0 rather than 1. Since digits in a number, indices in a sequence, etc. are often defined by these operations, zero-based counting feels more natural.
As to your problem, it can be solved by consistently using half-open ranges, which is another good idea that works well with mine :-)
Of course they’re three seats. “10th” is not a seat, it’s a fencepost! If you want “the 7th, 8th, 9th, and 10th seats” you should say 7th thru 11th.
You should say “7th to 11th”; “thru” (i.e. “through”) specifically implies inclusion of the right endpoint.
(Although unfortunately, “to” doesn’t likewise specifically imply exclusion.)
The main examples to me are timekeeping, modular arithmetic, and memory addressing. The first moment of time, the first modulus and the first memory address are all 0. It seems harder to come up with natural examples where the first something is 1.
Your problem would be solved by using half-open ranges everywhere, which is another good idea that works well with mine.