Thinking Forth:
Thus in computer terms it makes sense to call the “first record” the 0th record.
OMG no! 😭
Listen, whenever I talk about this I get flak from people who are really on the same page as me how the compiler should work. We’re just on opposite pages on how to talk about it.
We both want this:
If frotz is “abcde”, frotz[0] is a, frotz[2] is c and so on. If that’s through list-ref or pointers or whatever that’s all the same.
When I’ve been arguing against Dijsktra and now Leo Brodie, it’s not because I disagree with any of that. We’re 100% on the same page on that. I’m not asking for “one-indexed arrays” a la Lua.
But I don’t think of frotz[0] as the “zeroeth” record, I think of it as the first record.
If I’m at the first door, it’s right there, I need to walk zero steps. If I want the third door, it’s two steps away from the first door. I think of the number in the brackets as not the ordinal of the door but as the cardinal of the offset.
When people are like “programmers count starting at zero” I say no. Please don’t. We count just like normal people. You’re misleading people into off-by-one error hell.
Brodie, I don’t got too much beef with. On the preceding page he does use it normally:
first record starts at: 0 × 8 = 0
second record starts at: 1 × 8 = 8
third record starts at: 2 × 8 = 16Yes, great, perfect, you’ve got it, that’s the right way to think of it and talk about it.
Some other writers wrongly have tried to heap massive amounts of copium trying to redefine how people count, but we’re just redirecting what to count. The steps rather than the doors. The stairs rather than the floors. If you’re like: “numbering should start at zero” you’re spreading misinformation. I don’t call three apples “two apples” and the first apple “this is apple zero”. If frotz is “abcde”, the (cardinal) length of frotz is five, not four. And the fifth record, e, is frotz[4].