MenTaLguY wrote:
> On Wed, 2007-07-18 at 16:20 +0900, kevin cline wrote:
>>> The pebble in the Ruby shoe is the counter-intuitive use of indexing of
>>> elements of arrays, strings, etc., from 0 to n-1 instead of the more
>>> natural 1 to n.
>> With 50+ years of collective experience, it seems clear that zero-
>> based arrays lead to the simplest code.
> 
> That's been my personal experience, too -- pretty much the only thing
> 1-based indices make simpler is getting the last element of an array
> given its size; everything else seems to get more complex. 
> 
> -mental
Well ... the reason the first major programming language, FORTRAN, used
1-based indexing is that it was designed for scientific computing, which
uses matrices extensively. And a matrix in a textbook or research paper
almost always has row and column indices ranging from 1 to N. So ... one
of the things 1-based indexing makes simpler is thinking about matrices.

Assembly language programming, at least on binary machines, is a lot
more natural with 0-based indexing, since that's the way the hardware is
laid out.