3 ms·
> "0:4 picks out index 0, 1 and 2, which are the first, second and third element of the array." I don't think that's right? It should pick out four things, not
by saghm 8y ago
> "0:4 picks out index 0, 1 and 2, which are the first, second and third element of the array."
I don't think that's right? It should pick out four things, not three.
Of course, you could argue that getting that wrong proves your point! I personally still prefer 0-indexing, but I definitely agree with you that having an exclusive upper bound is confusing.
- Certhas 8y agoYou're right of course. Not intentional. 0:3 picks out index 0, 1, 2. So 1:3 picks out the second and third element, which are indexed by 1 and 2 respectively. My guess is that what one prefers probably depends entirely on the data structures one works with most....
- shele 8y agoI like how you got it wrong, proving your point.