[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: One-based indexes in XPath

Subject: Re: One-based indexes in XPath
From: Justin Johansson <procode@xxxxxxxxxxx>
Date: Wed, 21 May 2008 02:37:38 +0900
Re:  One-based indexes in XPath
In response to my question, thanks Colin for being the first devil's
advocate for 1-based indexes.

Possibly I am wrong about 0 being the norm.  Please enlighten me.  I was
only going on ubiqitous languages like C++, C#, Java & Javascript.

Would you also please justify your claim " It is a very poor choice".

Sure we can skip the first memory cell in $0.02 per meg RAM; but why is 0
poor wrt 1?  What's wrong with -1 then?

Respectfully, Justin Johansson

At 05:48 PM 20/05/2008 +0100, you wrote:
>Zero is NOT the norm for modern programming languages. It might well
>be for ancient ones. It is a very poor choice, justifiable only when
>trying to squeeze the last ounce of speed in a highly
>numerically-intensive application.
>And even there it is not justified - you simply use data structures
>that have an unused first element, and so avoid the subtract one
>operation in that way.

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.