[TUHS] Array index history
bakul at bitblocks.com
Thu Jun 8 10:47:33 AEST 2017
On Wed, 07 Jun 2017 07:20:43 MDT arnold at skeeve.com wrote:
> Basically, until C came along, the standard practice was for indices
> to start at 1. Certainly Fortran and Pascal did it that way.
Pascal's array type syntax is
array-type: "array" "[" index-type "]" "of" type
Index type could be an integer sub-range or scalar type or
scalar sub-range. Pascal doesn't allow specifying array size
with a simple integer so the question of default index for
first element doesn't arise.
In spite of having learned and used Pascal, PL/I, Fortran and
APL before C, a lower bound of 0 seemed most sensible to me.
Not because of any efficiency reasons but because of modular
arithmetic which I learned before C!
More information about the TUHS