Gollum@feddit.org to Programmer Humor@programming.dev · 1 year agoAnother smart movefeddit.orgexternal-linkmessage-square112linkfedilinkarrow-up11Karrow-down10
arrow-up11Karrow-down1external-linkAnother smart movefeddit.orgGollum@feddit.org to Programmer Humor@programming.dev · 1 year agomessage-square112linkfedilink
minus-squareIndustryStandard@lemmy.worldlinkfedilinkarrow-up9·1 year agoIt would screw up existing code but doing [array.length() -1] is pretty stupid.
minus-squarethedeadwalking4242@lemmy.worldlinkfedilinkarrow-up5·edit-21 year agoFor i = 0; I < array.length; i++
minus-squareIndustryStandard@lemmy.worldlinkfedilinkarrow-up3·1 year agoCasually throws in capitals as well.
minus-squarethedeadwalking4242@lemmy.worldlinkfedilinkarrow-up2·1 year agoMy post is a work of fiction
minus-squaredan@upvote.aulinkfedilinkarrow-up3·1 year 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.