Python "why" questions

Steven D'Aprano steve-REMOVE-THIS at cybersource.com.au
Thu Aug 19 04:58:12 CEST 2010


On Wed, 18 Aug 2010 14:47:08 -0700, Russ P. wrote:

> Is the top team in the league the number 1 team -- or the number 0 team?
> I have yet to hear anyone call the best team the number 0 team!

Why is the top team the one with the lowest number?


> Unfortunately, we're stuck with this goofy numbering system in many
> languages. Fortunately, the trend is away from explicit indexing and
> toward "for" loops when possible.

Agreed on the second sentence there, but not on the first. There's 
nothing "goofy" about indexing items from 0. Yes, it does lead to slight 
more difficulty when discussing which item you want in *human* languages, 
but not in *programming* languages. The nth item is always the nth item. 
The only difference is whether n starts at 0 or 1, and frankly, if you 
(generic you, not you personally) can't learn which to use, you have no 
business pretending to be a programmer.



-- 
Steven



More information about the Python-list mailing list