[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Selenophobia
- From: Tim Hill <drtimhill@...>
- Date: Sat, 25 Mar 2017 13:57:48 -0700
> On Mar 25, 2017, at 3:53 AM, Joseph Manning <firstname.lastname@example.org> wrote:
> On 2017-Mar-25 (Sat) at 12:42 (+0200), steve donovan wrote:
> Yes! In fact, 1-based indexing is one of the ( several ) reasons
> that I like Lua. I detest either using, or teaching, the unnatural
> "0 to length-1" pattern of many other "high-level"(?) languages.
> But you're right -- "each to their own". 0 versus 1 debates are
> similar to emacs versus vi debates :-)
To my mind both have their place. 0-based indexing makes perfect sense in C, where indexing is little more than syntactic sugar over pointer+offset anyway — but really that’s because C was designed (to my mind) as a reified assembly language anyway. However, once you get into higher abstractions (such as any decent script language) 0-based ceases to have much validity imho.