From: Peter Cooper Date: 2007-07-17T18:37:53+09:00 Subject: Re: The Pebble in the Ruby Shoe ------=_Part_81853_7015221.1184665066301 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/17/07, Frank Church wrote: > > Chinese count birthdays starting with the child's first year as year > 1. As a westerner do you consider it natural describe a child as 2 > years old on its "first" birthday? > > It may be counterintuitive but in the mathematical world it is quite > natural. It depends how you look at arrays. If you think of each element as, well.. an "element" then the argument for 1 based arrays is supported by how things work in real life. For example, you would consider the first year of a child's existence to be "year 1". Year 1 is "the year" (that is, the "element") between birth and the age of 1. If you split things into boxes, which, arguably, is what an array is, then starting from 1 actually makes sense. A line of boxes is not inherently 0-based. You have boxes 1, 2, 3, and so forth.. but no-one says the first element of a collection of natural items is "item 0." I don't see the original post as a troll at all other than in its implication that Ruby is a "human friendly" programming language. It might be "human friendly" but that human is a computer programmer.. If Ruby was meant to be novice friendly, then sure, 1-based indexing makes sense. Of course, I quite like 0-based indexing, though I recognize it doesn't really make much sense in layman's terms.. but most of computer science doesn't. Cheers, Peter Cooper http://www.petercooper.co.uk/ ------=_Part_81853_7015221.1184665066301--