4 ms·
But indexing is not counting. It bears some similarity to measuring, though. If you look at a ruler, does it begin with a "1"? Or does it have a "1" one unit fr
by jleader 15y ago
But indexing is not counting. It bears some similarity to measuring, though. If you look at a ruler, does it begin with a "1"? Or does it have a "1" one unit from the beginning?
- forkandwait 15y agoIt IS counting when it measures discrete elements, and it is measuring when it measures distance from a boundary. Discrete sets and continuous sets are very different beasts, and some of the mix-up here seems to be from ignoring their differences.
- deleted 15y ago[deleted]
- stan_rogers 15y agoIndexing is only "not counting" when you're working with a base address and an offset. In most languages, that's only an "under the hood" reality; the programmer is neither interested in, nor has direct access to, the bitly goodness underlying the array (or what have you). It's just a bunch of slots, and when you want to put something into (or take something out of) the first slot, then the natural ordinal is "first", not "zeroth". We're just used to a different way of doing things; it doesn't make any more sense to anyone, except by convention.