From: Steven Lumos Date: 2007-07-19T09:10:22+09:00 Subject: Re: The Pebble in the Ruby Shoe SonOfLilit writes: > I disagree. Zero based arrays are natural to a mathematician, and > programmers tend to be mathematicians. No! This is a systematic lie used to defend a convention that was adopted for purely practical reasons. It's like claiming that segmented memory is more natural to mathematicians. Mathematicians and even Computer Scientists consistently use 1, e.g. x_1, x_2, ..., x_n The 0 ("not") subscript--when used--usually shows up in situations not really analogous to arrays, in order to INCREASE synchronization with units, instead of decreasing it as 0-based arrays do (t_0 as the instant of starting, t_1 the instant of 1 time unit from t_0, etc.) Similarly, a[0] is NOT the "zeroth" ("Coming next in a series before the one conventionally regarded as the first") element! > It's humanity that has the wrong clue. I hate the problems that > one-based counting creates. Anywhere, not just in arrays. > > Aur There are always trade-offs. It's certainly the case that the decision is made for Ruby. It's a good and safe decision supported by decades of computing convention and habit, if not mathematical convention. (Configurable array indexing is an abomination created by people who must have thought that only a single author and the machine have any business reading a program.) Steve P.S. I'm talking about U.S. English speaking mathematicians, since that's my only direct experience. P.P.S. I must say, you've either worked with a much higher class of programmers, or lower class of mathematicians than I have though.