Gollum to Programmer [email protected] • 6 months agoAnother smart movefeddit.orgimagemessage-square115fedilinkarrow-up1990
arrow-up1990imageAnother smart movefeddit.orgGollum to Programmer [email protected] • 6 months agomessage-square115fedilink
minus-square@[email protected]linkfedilink9•6 months agoIt would screw up existing code but doing [array.length() -1] is pretty stupid.
minus-square@[email protected]linkfedilink3•6 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.