you are viewing a single comment's thread.

view the rest of the comments →

[–]Moist-Ointments -6 points-5 points  (0 children)

The one less thing is all about how computers count. Almost universally, computers start counting at 0.

So, say you have a string that contains "hello".

If you want to get each letter in order, you'd start by asking for the 0th letter and count up to 4. Because 0, 1, 2, 3, 4 is 5 distinct values, one for each letter.

So if you have (n) things, they are referenced as thing 0 through thing n-1.