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

Start indexing at one #43

Open
njordhov opened this issue Dec 10, 2020 · 0 comments
Open

Start indexing at one #43

njordhov opened this issue Dec 10, 2020 · 0 comments
Labels
non-backwards-compatible Features that can not be implemented in a backwards-compatible manner

Comments

@njordhov
Copy link

njordhov commented Dec 10, 2020

Computers count from zero; people count from one. Zero-based indexing can be confusing for non-developers and programming novices. Humans generally find one-based indexing more intuitive, where in the list (1 2 3) the first item is found in position one rather than at index zero.

Discussing the intent of Clarity contracts with non-programmers will benefit from one-based indexing.

Choosing between zero-based and one-based indexing is a programming language design decision. Programmers should be able to adapt to either. While many programming languages, and close to the metal systems languages in particular, typically uses zero-based indexing, major programming languages used for mathematics have one-based indexing, including Mathematica, Matlab, and R. Other languges with one-based indexing includes Julia, Lua, Erlang, Smalltalk, Many high-level domain-specific languages also use one-based indexing.

@kantai kantai added the non-backwards-compatible Features that can not be implemented in a backwards-compatible manner label Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-backwards-compatible Features that can not be implemented in a backwards-compatible manner
Projects
None yet
Development

No branches or pull requests

2 participants