News for hackers. Stuff that matters.
Re:Controversial Programming Opinions (2012) by umanwizard on Saturday December 05, 2020 @07:47AM (#25314137)
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.

Re:Controversial Programming Opinions (2012) by cambalache on Saturday December 05, 2020 @11:55AM (#25316002)
> 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.