Gollum@feddit.org to Programmer Humor@programming.dev · 29 days agoAnother smart movefeddit.orgexternal-linkmessage-square109fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1external-linkAnother smart movefeddit.orgGollum@feddit.org to Programmer Humor@programming.dev · 29 days agomessage-square109fedilink
minus-squareIndustryStandard@lemmy.worldlinkfedilinkarrow-up0·29 days agoIt would screw up existing code but doing [array.length() -1] is pretty stupid.
minus-squarethedeadwalking4242@lemmy.worldlinkfedilinkarrow-up0·29 days agoFor i = 0; I <= array.length; i++
minus-squarexthexder@l.sw0.comlinkfedilinkarrow-up0·29 days agoi < array.length or else you overflow.
minus-squareIndustryStandard@lemmy.worldlinkfedilinkarrow-up0·28 days agoCasually throws in capitals as well.
minus-squarethedeadwalking4242@lemmy.worldlinkfedilinkarrow-up0·28 days agoMy post is a work of fiction
minus-squaredan@upvote.aulinkfedilinkarrow-up0·29 days agoA lot of languages have a .last() or negative indexer ([-1]) to get the last item though.
It would screw up existing code but doing [array.length() -1] is pretty stupid.
For i = 0; I <= array.length; i++
i < array.length
or else you overflow.Casually throws in capitals as well.
My post is a work of fiction
A lot of languages have a
.last()
or negative indexer ([-1]
) to get the last item though.