Gollum@feddit.org to Programmer Humor@programming.dev · 8 days agoAnother smart movefeddit.orgimagemessage-square116fedilinkarrow-up1988arrow-down134
arrow-up1954arrow-down1imageAnother smart movefeddit.orgGollum@feddit.org to Programmer Humor@programming.dev · 8 days agomessage-square116fedilink
minus-squareIndustryStandard@lemmy.worldlinkfedilinkarrow-up9·7 days agoIt would screw up existing code but doing [array.length() -1] is pretty stupid.
minus-squarethedeadwalking4242@lemmy.worldlinkfedilinkarrow-up4·edit-27 days agoFor i = 0; I < array.length; i++
minus-squareIndustryStandard@lemmy.worldlinkfedilinkarrow-up3·7 days agoCasually throws in capitals as well.
minus-squarethedeadwalking4242@lemmy.worldlinkfedilinkarrow-up2·7 days agoMy post is a work of fiction
minus-squaredan@upvote.aulinkfedilinkarrow-up3·7 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++
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.