News for hackers. Stuff that matters.
Re:A Nerd’s Way to Walk Up the Stairs (2011) by jacobolus on Saturday August 18, 2018 @01:15PM (#17789452)
0-indexing steps is clearly the only reasonable choice. Who in their right mind would call the ground the “first step”?
Re:A Nerd’s Way to Walk Up the Stairs (2011) by davchana on Saturday August 18, 2018 @02:32PM (#17789841)
Ground is never a step; zero or one; not. Because while we are on ground; we are on same level, stairs have not started yet. As soon as we put our foot on upper level than the other foot, stairs have started & that upper foot marks the / lands on "first" step.
Re:A Nerd’s Way to Walk Up the Stairs (2011) by DougBTX on Saturday August 18, 2018 @03:12PM (#17790061)
Following the principle that array indexes are “between” the elements, the bottom of the first step is 0, and the top of the first step is 1. Then the ground, which is equal in elevation to the bottom of the first step, is at 0, and the floor after the last step is N, one past the index of the last valid step, N-1.

Half open zero based ranges are quite satisfying :-)

Re:A Nerd’s Way to Walk Up the Stairs (2011) by exegete on Saturday August 18, 2018 @05:07PM (#17790691)
I think it's the same people who call the ground floor the first floor. Coincidentally, I often have an off-by-one error in elevators.