Are there other common "c-like" or non "c-like" languages with non zero index array position? [closed] Are there other common "c-like" or non "c-like" languages with non zero index array position? [closed] arrays arrays

Are there other common "c-like" or non "c-like" languages with non zero index array position? [closed]


A list can be found on wikipedia.

ALGOL 68APLAWKCFMLCOBOLFortranFoxProJuliaLuaMathematicaMATLABPL/IRingRPGSassSmalltalkWolfram LanguageXPath/XQuery


Fortran starts at 1. I know that because my Dad used to program Fortran before I was born (I am 33 now) and he really criticizes modern programming languages for starting at 0, saying it's unnatural, not how humans think, unlike maths, and so on.

However, I find things starting at 0 quite natural; my first real programming language was C and *(ptr+n) wouldn't have worked so nicely if n hadn't started at zero!


A pretty big list of languages is on Wikipedia under Comparison of Programming Languages (array) under "Array system cross-reference list" table (Default base index column)

This has a good discussion of 1- vs. 0- indexed and subscriptions in general

To quote from the blog:

EWD831 by E.W. Dijkstra, 1982.

When dealing with a sequence of length N, the elements of which wewish to distinguish by subscript, thenext vexing question is what subscriptvalue to assign to its startingelement. Adhering to convention a)yields, when starting with subscript1, the subscript range 1 ≤ i < N+1;starting with 0, however, gives thenicer range 0 ≤ i < N. So let us letour ordinals start at zero: anelement's ordinal (subscript) equalsthe number of elements preceding it inthe sequence. And the moral of thestory is that we had better regard—after all those centuries!— zero as amost natural number.

Remark:: Many programming languages have been designed without dueattention to this detail. In FORTRANsubscripts always start at 1; in ALGOL60 and in PASCAL, convention c) hasbeen adopted; the more recent SASL hasfallen back on the FORTRAN convention:a sequence in SASL is at the same timea function on the positive integers.Pity! (End of Remark.)