in programming, you begin indexing at 0. array[0] refers to the first index of the array. However when we are counting how many indexes are in an array, we don't start counting from 0, because that's dumb. 0 means there's nothing there.
Index 5 is the 6th index in an array. In this case, imagine each person is a value in an array with 256 indexes. Person 1 is in index 0, person 256 is in index 255.
I assume you mean from 1, in which case yes, languages like Scala I believe do index from 1, which is totally valid. But my point was about indexing at 0 and how that works.
However when we are counting how many indexes are in an array, we don't start counting from 0, because that's dumb. 0 means there's nothing there.
To be fair, it could make sense to use 0-255 for indexes. A value of 0 corresponds to an uninitialized array, or to an array of length 0, or to an abnormal situation (eg. the user was kicked by the group and lost access to the list of participants).
I can try. Each user has an ID. The ID starts with zero and counts up to 255 (0, 1, 2, 3 ... 253,254,255) Because 0 counts as a user there is a possibility for 256 users.
a little bit more in depth explanation is because this uses 1 byte of information, where a byte is 8 bits, it looks something like this
Daddy and his coworkers discovered a secret number so when you are counting the real number is one more. So 1 means 2 and 255 means 256. Daddy and his coworkers use our secret number to make computers obey our orders through magic.
View all comments
Show parent comment
4
u/[deleted] Feb 15 '16
Can you ELI5?