Why do indexes in XPath start with 1 and not 0?
Some colleagues and I were comparing past languages we had programmed in and were chuckling about our experience with **VBScript** with its **odd** features such as **1-based index** instead of 0-based indexes like almost every other language has, the reasoning being that it was a **language for users** (e.g. Excel VBA) instead of a language for developers.

Then someone said, "**XPath also has 1-based indexes**" which I couldn't believe until I found [this article][1] in which Michael Kay admits:

> ...hardware addressing is not the only
> benefit of 0-based addressing ... it
> also makes computations easier...

but then goes on to say:

> ...1-based logic was the right choice for XPath and XSLT...because the language was designed
> for users, not for programmers, and
> users still have this old-fashioned
> habit of referring to the first
> chapter in a book as Chapter One...

Can someone explain that to me?  **(1) How is XPath designed for users?** I can't imagine anyone who is not a developer wrangling with the syntactical rigidity of XPath or the declarative/functional-programming-aspects of XSLT. and **(2) Why really did the creators of XPath go against the norm of modern programming languages by choosing a 1-based index?**




  [1]: http://mukulgandhi.blogspot.com/2008/05/blog-post.html
Why do indexes in XPath start with 1 and not 0?
===

Some colleagues and I were comparing past languages we had programmed in and were chuckling about our experience with **VBScript** with its **odd** features such as **1-based index** instead of 0-based indexes like almost every other language has, the reasoning being that it was a **language for users** (e.g. Excel VBA) instead of a language for developers.

Then someone said, "**XPath also has 1-based indexes**" which I couldn't believe until I found [this article][1] in which Michael Kay admits:

> ...hardware addressing is not the only
> benefit of 0-based addressing ... it
> also makes computations easier...

but then goes on to say:

> ...1-based logic was the right choice for XPath and XSLT...because the language was designed
> for users, not for programmers, and
> users still have this old-fashioned
> habit of referring to the first
> chapter in a book as Chapter One...

Can someone explain that to me?  **(1) How is XPath designed for users?** I can't imagine anyone who is not a developer wrangling with the syntactical rigidity of XPath or the declarative/functional-programming-aspects of XSLT. and **(2) Why really did the creators of XPath go against the norm of modern programming languages by choosing a 1-based index?**




  [1]: http://mukulgandhi.blogspot.com/2008/05/blog-post.html