News for hackers. Stuff that matters.
Re:Again on 0-based vs. 1-based indexing by ufo on Wednesday January 20, 2021 @01:02PM (#25849622)
One of the more common examples is if you need to iterate backwards. It's awkward because the [0,N) interval becomes (N,0].

for(i=N-1; i>=0; i--)

Re:Again on 0-based vs. 1-based indexing by naniwaduni on Wednesday January 20, 2021 @02:46PM (#25851028)
Notably, this requires you to use a signed index type, which is absurd.

The alternative is to use the so-called goes-to operator: for (i=N; i --> 0;). But this actually relies on the postincrement semantics, which is a huge wart.