Gollum@feddit.org to Programmer Humor@programming.dev · 12 days agoAnother smart movefeddit.orgimagemessage-square15fedilinkarrow-up14arrow-down11
arrow-up13arrow-down1imageAnother smart movefeddit.orgGollum@feddit.org to Programmer Humor@programming.dev · 12 days agomessage-square15fedilink
minus-squareJackbyDev@programming.devlinkfedilinkEnglisharrow-up0·12 days agoArrays not starting at 1 bother me. I think the entrenched 0-based index is more important than any major push to use 1 instead, but if I could go back in time and change it I would.
minus-squareOvershoot2648@lemm.eelinkfedilinkarrow-up0·12 days agoIt really doesn’t make sense to start at 1 as the value is really the distance from the start and would screw up other parts of indexing and counters.
minus-squareIndustryStandard@lemmy.worldlinkfedilinkarrow-up1·12 days agoIt would screw up existing code but doing [array.length() -1] is pretty stupid.
Arrays not starting at 1 bother me. I think the entrenched 0-based index is more important than any major push to use 1 instead, but if I could go back in time and change it I would.
It really doesn’t make sense to start at 1 as the value is really the distance from the start and would screw up other parts of indexing and counters.
It would screw up existing code but doing [array.length() -1] is pretty stupid.