4 ms·
There are only two hard things. This is an aside, but I think that "index" is the wrong name. I wish that "index" meant you start counting at 1 (which everyone
by phaedryx 6y ago
There are only two hard things.
This is an aside, but I think that "index" is the wrong name. I wish that "index" meant you start counting at 1 (which everyone outside of CS does) and "offset" was the name for starting at 0.
- nvader 6y ago1ndex and 0ffset. I like it.
- Pet_Ant 6y agoI think I will intentionally start using this usage. Maybe we can make it a thing. I mean we already have argument & parameter for similar things to make a distinction.
- zajio1am 6y ago> (which everyone outside of CS does) In set theory (math foundations), ordinals also start at 0.
- deleted 6y ago[deleted]
- layer8 6y agoThat usage gets awkward though when you want to talk about the offset from one array index to another (and the array is 0-based). In actual (common) usage, the distinction between index and offset is the distinction between absolute and relative positions.