Re:Numbering should start at zero: E.W. Dijkstra
by frhack on Friday March 21, 2025 @12:32PM
(#43437733)
Starting from zero saves memory.
If I have a variable used as an index for an array of 256 elements, starting from 0 allows me to store it in a single byte. If I start from 1, I need two bytes, effectively doubling the memory usageāan unnecessary 100% increase.
Now, multiply this inefficiency across every instance where programs encounter a similar situation.
[ Parent
| on HN ]