Gollum@feddit.org to Programmer Humor@programming.dev · 1 day agoAnother smart movefeddit.orgexternal-linkmessage-square108fedilinkarrow-up1926arrow-down130
arrow-up1896arrow-down1external-linkAnother smart movefeddit.orgGollum@feddit.org to Programmer Humor@programming.dev · 1 day agomessage-square108fedilink
minus-squareIndustryStandard@lemmy.worldlinkfedilinkarrow-up7·24 hours agoIt would screw up existing code but doing [array.length() -1] is pretty stupid.
minus-squarethedeadwalking4242@lemmy.worldlinkfedilinkarrow-up4·edit-219 hours agoFor i = 0; I < array.length; i++
minus-squareIndustryStandard@lemmy.worldlinkfedilinkarrow-up2·10 hours agoCasually throws in capitals as well.
minus-squarethedeadwalking4242@lemmy.worldlinkfedilinkarrow-up1·6 hours agoMy post is a work of fiction
minus-squarexthexder@l.sw0.comlinkfedilinkarrow-up5·22 hours agoi < array.length or else you overflow.
minus-squaredan@upvote.aulinkfedilinkarrow-up2·23 hours 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++
Casually throws in capitals as well.
My post is a work of fiction
i < array.length
or else you overflow.A lot of languages have a
.last()
or negative indexer ([-1]
) to get the last item though.