OK icon indicating copy to clipboard operation
OK copied to clipboard

One based indexing

Open LifeIsStrange opened this issue 3 years ago • 1 comments

I believe a language that strive for minimizing cognitive overhead, should have indexes (e.g for arrays) have 1 for starting value and not zero. Doing so is significantly more intuitive and avoid a gigantic number of off by one errors (e.g no longer a mismatch between lastindex and .size()

Julia is showing to the world that this feature can be well adopted.

LifeIsStrange avatar Aug 30 '22 00:08 LifeIsStrange

Why not mandatory either the 0+ prefix or -1 postfix to any semantical indexing expression? Like a[0+offset], a[itemno-1].

complyue avatar Oct 19 '22 10:10 complyue