|
|
|
|
|
by jacknews
1061 days ago
|
|
So the first item in my array of 13 items is at position '0'. The 3rd item is at position '2'. And if I want to count the items in my array I start at '0' and keep going until I get to '12'. Even though there are 13 items in my array? I see. zero-indexing is good for system-level stuff, for dealing with actual memory and so on, but I'm still not convinced it's the right way. It's certainly not the one true way, 1-based indexing is completely valid for some use-cases like maths. Either way, there will be off-by-one difficulties, either in ordinals or count or whatever, so it's a trade-off. |
|