jesseduffield / OK

Welcome to the future of programming languages: OK?
MIT License
537 stars 17 forks source link

One based indexing #11

Open LifeIsStrange opened 2 years ago

LifeIsStrange commented 2 years ago

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.

complyue commented 2 years ago

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