Gollum@feddit.org to Programmer Humor@programming.dev · 9 months agoAnother smart movefeddit.orgimagemessage-square112linkfedilinkarrow-up11Karrow-down136
arrow-up1968arrow-down1imageAnother smart movefeddit.orgGollum@feddit.org to Programmer Humor@programming.dev · 9 months agomessage-square112linkfedilink
minus-squareIndustryStandard@lemmy.worldlinkfedilinkarrow-up9arrow-down1·9 months agoIt would screw up existing code but doing [array.length() -1] is pretty stupid.
minus-squarethedeadwalking4242@lemmy.worldlinkfedilinkarrow-up5·edit-29 months agoFor i = 0; I < array.length; i++
minus-squarexthexder@l.sw0.comlinkfedilinkarrow-up6·9 months agoi < array.length or else you overflow.
minus-squareIndustryStandard@lemmy.worldlinkfedilinkarrow-up3·9 months agoCasually throws in capitals as well.
minus-squarethedeadwalking4242@lemmy.worldlinkfedilinkarrow-up2·9 months agoMy post is a work of fiction
minus-squaredan@upvote.aulinkfedilinkarrow-up3·9 months 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.lengthor 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.