3 ms·
I think so, too, but my point is that it makes sense for other historical reasons—not the one the poster mentions. Those decisions weren't made due to mathemati
by andrewmcwatters 3y ago
I think so, too, but my point is that it makes sense for other historical reasons—not the one the poster mentions. Those decisions weren't made due to mathematics.
- doctor_eval 3y agoAgree. I came here to say that 0-based is more sensible, but as I thought through my arguments, I realised that I’m wrong. I do most of my coding in TS, Go and plpgsql. PL is 1 based, but the only time I find it frustrating is when translating between language boundaries. The rest of the time it’s just convention (eg, using <= instead of < in loops). But I realised that I frequently want to get the last element in an array, and of course it’s easier with 1-based arrays. So ultimately I don’t think it matters, except that most people are used to 0-based which can cause cognitive friction.