Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One based indexing #11

Open
LifeIsStrange opened this issue Aug 30, 2022 · 1 comment
Open

One based indexing #11

LifeIsStrange opened this issue Aug 30, 2022 · 1 comment

Comments

@LifeIsStrange
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants