GulfOfMexico
GulfOfMexico copied to clipboard
array indexing should start from the center
i feel that starting array indexing at -1 is very counterintuitive. instead it should start at the center, 0 is the middle element of the array, negative indexes are before, and positive indexes after the center. arrays with an even number of elements skip the 0.
so a 10-element array is indexed [-5,-4,-3,-2,-1,1,2,3,4,5] and an 11-element array would be [-5,-4,-3,-2,-1,0,1,2,3,4,5]
Doing arr[0] on a even number array should return randomly between arr[-1] and arr[1] to prevent annoying errors