A major source of off-by-one errors for me is that with 0-based indexing there is no simple way to know the last element in an array. len(foo)-1 is convoluted.
Feature request: last(foo) should be the same as (len(foo)-1) thus making the intent very clear.
A major source of off-by-one errors for me is that with 0-based indexing there is no simple way to know the last element in an array.
len(foo)-1
is convoluted.Feature request:
last(foo)
should be the same as(len(foo)-1)
thus making the intent very clear.