title: Why do indexes in XPath start with 1 and not 0?
body: <p>Some colleagues and I were comparing past languages we had programmed in and were talking about our experience with <strong>VBScript</strong> with its <strong>odd</strong> features such as <strong>1-based index</strong> instead of 0-based indexes like almost every other language has, the reasoning being that it was a <strong>language for users</strong> (e.g. Excel VBA) instead of a language for developers.</p>
  
  <p>Then someone said, "<strong>XPath also has 1-based indexes</strong>" which I couldn't believe until I found <strong><a href="http://mukulgandhi.blogspot.com/2008/05/blog-post.html" rel="noreferrer">this article</a></strong> in which many reasons are given <strong>in favor of the 0-based approach</strong> including some from Michael Kay himself:</p>
  
  <ul>
  <li><em>"...zero-based indexing tends to make the index formulae simpler when accessing a multi-dimensional array with a one-dimensional array access expression"</em> </li>
  <li><em>"when handling tables, or subscripting into strings, zero-based addressing would often be much more convenient"</em> </li>
  <li><em>"...hardware addressing is not the only benefit of 0-based addressing ... it also makes computations easier..."</em></li>
  </ul>
  
  <p>but then Michael Kay is quoted as concluding:</p>
  
  <blockquote>
    <p>...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...</p>
  </blockquote>
  
  <p>Can someone explain that to me?  <strong>(1) How is XPath designed for users?</strong> 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 <strong>(2) Why really did the creators of XPath go against the norm of modern programming languages by choosing a 1-based index?</strong></p>