Some questions on Slate syntax

Lee Salzman lsalzman1 at cox.net
Sun Mar 27 07:25:48 PST 2005


The whole "0-based" vs. "1-based" thing is misleading. When you are 
talking about "at:", you are locating some item in space by a coordinate 
- addressing. Memory is a spatial thing. Counting is just a different 
idiom entirely - searching. The thinking is, "I want that thing, 
there!", as opposed to, "Hmm, that's not what I want. Not that either. 
Oh, this one!"

Lee

Shaping wrote:

>> 1. Why 0-based arrays?
>>
>> 0-based arrays don't seem to be as intuitive and easy to use as
>> 1-based.  If you want to create an array with x elements, the last
>> element's index is x-1, rather than just plain old x.  Not only is
>> there an extra calculation involved, but if you're careless or just
>> happen to typed a typo, you'll get one of those bugs that you'll want
>> to slap yourself in the face with.
>
>
> I have the same question/complaint, despite the slight improvement in 
> machine-efficiency it creates.  The convention produces much 
> programmer inefficiency--extra thinking/translating/checking.  
> Counting starts at 1.
>
>
> Shaping
>
>




More information about the Slate mailing list