Gollum to Programmer [email protected] • 17 hours agoAnother smart movefeddit.orgimagemessage-square79fedilinkarrow-up1664arrow-down121
arrow-up1643arrow-down1imageAnother smart movefeddit.orgGollum to Programmer [email protected] • 17 hours agomessage-square79fedilink
minus-square@IndustryStandardlink4•6 hours agoIt would screw up existing code but doing [array.length() -1] is pretty stupid.
minus-square@[email protected]linkfedilink2•5 hours 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.
A lot of languages have a
.last()
or negative indexer ([-1]
) to get the last item though.For i = 0; I < array.length; i++
i < array.length
or else you overflow.