4 ms·
To which they should cleverly reply, "Aha! You said 'first' centimeter, not 'zeroth' centimeter, thus defeating your own argument."
by doodpants 6y ago
To which they should cleverly reply, "Aha! You said 'first' centimeter, not 'zeroth' centimeter, thus defeating your own argument."
- ycombobreaker 6y agoDoesn't that just demonstrate your (edit: the teacher's) point exactly? The first centimeter starts at 0. The first array element starts at 0.
- deleted 6y ago[deleted]
- TuringTest 6y agoNo, that's the lower bound of the first array element.
- nybble41 6y agoIt's the offset of the first array element from the start of the array. The first element is at the start of the array, so the offset is naturally zero—there are zero elements prior to the first element. Like the markings on a ruler, array indices are cardinal numerals (0, 1, 2, …) counting the distance from a reference point, not ordinal numerals (1st, 2nd, 3rd, …) representing rank in a sequential order.
- TuringTest 6y agoIf you're comparing arrays to centimeters on a ruler, the first element is at the center of the first cell; at zero, there's the left border of the first cell. (Also please note that both this and my previous reply are tongue-in-cheek).
- gjm11 6y agoSomeone I knew at university, who prefers starting at 0 (for mathematical, rather than computational, reasons) made the following argument/proposal. "First" is an abbreviated form of "foremost". So if you start counting at 0, "first" corresponds to index 0. There's no real clash here yet; "first" and "one" are entirely separate terms. "Second" is from Latin "secundus" meaning "following"; the second thing follows the first. So "second" corresponds to index 1. Again, no clash yet; "second" and "two" are basically unrelated. "Third", though, actually derives from "three". So "third" has to correspond to index 3. This leaves a gap, which might perhaps be filled by a new word "twifth", corresponding to index 2. So now we have the cardinal numbers: zero, one, two, three. And the corresponding ordinals: first, second, twifth, third.
- mjevans 6y agoThe hypothetical student's sarcastic answer isn't technically correct. > you can just show them a ruler and > ask them where does the first centimeter start(s) The question involves a nuance of the english language, the distinction between a measure of wholeness and the contents of that unit. Length is a count of the completeness of a measure. The length of an interval must inherently include 0 as a unit to describe taking no units. A 0 starting index is likewise also required to indicate skipping no storage cells. Therefore an absolute index start must be zero based, and the Addition of duration must also include the option of zero as a means of describing a point at which to begin, but having not yet used any length. The subtle trick is that is a point, an array of zero size; this is why the length, or alternately absolute stop point, for an array storing anything is one higher. It isn't actually zero indexed, it's a different property of measure (the size or stopping address). A centimeter is also a wonderful example since it should graphically contain eight additional ticks for millimeter marks, and naught else, among it's inner span. This aligns wonderfully with explaining that there are targets spots for 8 bits of an octet within that single byte of indexed storage.
- deleted 6y ago[deleted]