Re:Again on 0-based vs. 1-based indexing
by improbable22 on Wednesday January 20, 2021 @08:25AM
(#25846123)
If "any language" means "any language sufficiently low-level to have C-like pointers", then no contest!
Surely the point of any language at all is to abstract away some details of the underlying hardware. Both for portability and to make things easier for human brains. How much you should abstract away obviously varies, based on what you're trying to do, and on how varied the hardware is.
And it depends on how much computation & memory you can give your compiler. One reason new languages can have nicer abstractions is that they don't have to compile on 1970s hardware.
Re:Again on 0-based vs. 1-based indexing
by pjmlp on Wednesday January 20, 2021 @08:59AM
(#25846490)
Ada, Pascal, Modula-2,....
Re:Again on 0-based vs. 1-based indexing
by wiz21c on Wednesday January 20, 2021 @09:29AM
(#25846801)
lisp, smalltalk, scheme, R.
Re:Again on 0-based vs. 1-based indexing
by zajio1am on Wednesday January 20, 2021 @12:27PM
(#25849134)
0-based arrays/indexes are also based on abstract concepts. 1-based ordinal numbers (in both maths and language) are just tradition from time before 0 was generally accepted. Set theory (as a clean design of math foundations) also starts ordinals at 0.
0-based arrays are based on hardware implementations; 1-based arrays are based on abstract collections; you could make the argument that 0-based arrays are a leaky abstraction, but the question then becomes: what abstraction? C explicitly tried not to abstract away the underlying hardware.