3 ms·
"And yes, counting from zero is slightly more efficient than starting at 1. Computers are built on a 0 and 1 numbering system that makes up everything (hello bi
by EpicEng 12y ago
"And yes, counting from zero is slightly more efficient than starting at 1. Computers are built on a 0 and 1 numbering system that makes up everything (hello binary!). Counting from 0, is just easier and creates efficiency."
Um... yeah. Who wrote this exactly? An actual programmer? And what does binary have to do with it? I am a fan of 0-indexing, don't get me wrong, but certainly we don't do it for the sake of efficiency. If anyone knows better let me know, but as far as I am aware it has much more to do with a more natural expression of a set, as well as dealing with pointers whose first element lies 0 elements away.
- dmcg 12y agoI was thinking that his point here would be that we always have to consider the noop case, the empty list etc. But no, so this item ironically added nothing to the piece.
- jheriko 12y agoyeah, its a terribly misleading comment... still he might be a programmer, just not a 'real programmer' - some kind of web dev or script kiddie, and therefore knows little or nothing about memory addressing
- drannex 12y agoFront-end web development, so yeah knows very little about memory addressing.
- neilk 12y agoThere have been programming languages that counted from 1. It's more convenient IMO to count from zero but we could have had different conventions.
- wazari972 12y agostarting counting at 0 is mainly because start + index * offset points to `start` when `offset` is 0 (ie, array indexing in C and other languages with 'direct' memory access). Any other reason?
- drannex 12y agoWow, yeah rereading it, that made absolutely zero sense. Update: Fixed the post, I wrote it at 4am, and just pulled that part from another source.
- EpicEng 12y ago...and re-reading mine, I probably should have left this bit out: "Who wrote this exactly? An actual programmer? "