3 ms·
> offsets are 0-based, indexes are offsets, therefore indexes should be 0-based You might dispute the premises, but I don’t see the circle. Isn’t this just “me
by codeflo 6y ago
> offsets are 0-based, indexes are offsets, therefore indexes should be 0-based
You might dispute the premises, but I don’t see the circle. Isn’t this just “men are mortal, Socrates is a man, therefore Socrates is mortal”?
- rrobukef 6y agoIt's missing 'since indexes are 0-based, they're offsets". Edit: if I would make this argument, I'd say the assumption that indexes are offsets is baseless. This is easily proven since there are languages where this isn't true. However I would argue the problem based on practical merits: the reason there no 1-based index op-code exists is because no dominant programming language has 1-based indexing. Which is a self-fulfilling prophesy.
- DanielBMarkham 6y agoI didn't want to go there, but yes. If I had called that out, it would lead to a discussion about just what is meant by the term "offset". Defined broadly enough, the point worked for the author. In general, I try to find the most general point and rebuttal as possible. These discussions tend to dive into pedantry and semantics. I'm just trying to do my part to engage the author where they are. ymmv