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