Also, it's what we're all used to, and it makes perfect sense to a lot of us, and the only times in recent memory I've ever made off-by-one errors were when I was trying to use Lua and its one-based indexing.
One reason for zero-based indexes that isn't "it's what we're all
used to" is that if you used one-based indexes, you would be able
to represent one fewer index than zero-based, since one of the
representable values - zero - could no longer be used to
represent any index.
- Re: Array start index Bastiaan Veelo via Digitalmars-d-learn
- Re: Array start index Bastiaan Veelo via Digitalmars-d-learn
- Re: Array start index pineapple via Digitalmars-d-learn
- Re: Array start index Nemanja Boric via Digitalmars-d-learn
- Re: Array start index bachmeier via Digitalmars-d-learn
- Re: Array start index Bastiaan Veelo via Digitalmars-d-learn
- Re: Array start index Ali Çehreli via Digitalmars-d-learn
- Re: Array start index Bastiaan Veelo via Digitalmars-d-learn
- Re: Array start in... Ali Çehreli via Digitalmars-d-learn
- Re: Array sta... Bastiaan Veelo via Digitalmars-d-learn
- Re: Array start in... Ali Çehreli via Digitalmars-d-learn
- Re: Array sta... Bastiaan Veelo via Digitalmars-d-learn
- Re: Array... Ali Çehreli via Digitalmars-d-learn