4 ms·
Not sure why 1-based indexing is more logical in high-level or scientific computing. The concept of x[k] meaning the object k spaces away from the beginning of
by umanwizard 6y ago
Not sure why 1-based indexing is more logical in high-level or scientific computing.
The concept of x[k] meaning the object k spaces away from the beginning of x is very general, and still intuitively meaningful in languages without pointer arithmetic.
- cambalache 6y ago> Not sure why 1-based indexing is more logical in high-level or scientific computing. Because mathematics and physics use 1-based array index since ever? I first learned about matrices in math classes, then in numerical methods (All 1-based) and then we programmed in Fortran (1-based). It is not that is more logical, it is just a convention. But I have seen wayyyy more people complaining about 1-based index languages than about 0-based languages.