Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> with 1-based indexing lower is 1 and upper is one greater than the number of elements.

Do you see +1 tweak? Also consider that "for loop" can't be expressed as </* interval and always expressed as <=/* interval. So 1-based indexing have to be either 1 <= i <= N (closed interval, bad, N - 1 != number of iterations) or 1 <= i < N + 1 (half open interval, good, but +1 tweak).



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: