Better HN
topnewbestaskshowjobs
Log inSign up

jackieee

2 karma · joined May 29, 2023 (3y ago) · 2 submissions

Submissions

comment 3y ago · link · parent

In my building the 1st floor is on set of stairs/1 elevator ride up, the real first floor (i.e the ground floor) is labeled lobby (or a big green button in the elevator).

0-based indexing makes just a much sense at higher level abstractions, aka iterators because there you're more likely to think in distances and ranges than indices, iter.advance(0) => stay where you are, so if iter is at the start, iter+0 is the first element.

comment 3y ago · link · parent

The current element is at distance 0 from iter[].