5 ms·
> 0 indices are hard? I started out with BASIC and Fortran, which use 1 based indices. Going to C was a small bump in the road getting used to that, and then i
by WalterBright 2y ago
> 0 indices are hard?
I started out with BASIC and Fortran, which use 1 based indices. Going to C was a small bump in the road getting used to that, and then it's Fortran which is the oddball.
- Ygg2 2y agoInteresting path. I went Basic, and Pascal and then C in college. Honestly it was such a mind twist.
- int_19h 2y agoMost oldschool BASIC dialects (including the original Dartmouth IIRC) use 0-based indices, though. It's the worst of both worlds, where something like: DIM a(10) actually declares an array of 11 elements, with indices from 0 to 10 inclusive. I believe it was QBASIC that first borrowed the ability to define ranges explicitly from Pascal, so that we could do: DIM a(1 TO 10) etc to avoid the "zero element tax"