Gollum to Programmer Humor@programming.dev • 5 months agoAnother smart movefeddit.orgimagemessage-square114arrow-up11K
arrow-up11KimageAnother smart movefeddit.orgGollum to Programmer Humor@programming.dev • 5 months agomessage-square114
minus-square@IndustryStandard@lemmy.worldlinkfedilink9•5 months agoIt would screw up existing code but doing [array.length() -1] is pretty stupid.
minus-square@thedeadwalking4242@lemmy.worldlinkfedilink5•edit-25 months agoFor i = 0; I < array.length; i++
minus-square@IndustryStandard@lemmy.worldlinkfedilink3•5 months agoCasually throws in capitals as well.
minus-square@dan@upvote.aulinkfedilink3•5 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.length
or 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.