Some questions on Slate syntax

Bill Sun billksun at yahoo.com
Sat Apr 2 00:51:57 PST 2005


I guess this really comes down to a matter of
preference.  For those that work with a lot of the low
level programming, 0-based is more natural, as it fits
the programming domain.

For my programming domain, 1-based arrays are more
convenient to me. For many of my applications, arrays
are basically a list of items.  And I like my list of
items numbered by their count.  I use collections as
well, but sometimes collections are too heavy, so I
fall back to arrays for performance requirements.

Nonetheless, like Steven Shaw wrote in his reply to
this topic, we could implement 1-based arrays
ourselves if we really want to. But also like he
mentioned, with the use if iterators, the conventional
approach of traversing through an array using a loop's
index number as the index of the array element seems
to be minimized.

-Bill Sun

--- Lee Salzman <lsalzman1 at cox.net> wrote:
> Thinking order does not help, as that was what I was
> thinking when I
> wrote that it makes no intuitive sense to me
> elsewhere. A given set of
> numbers does not describe order, it merely has
> order. Why do street
> addresses start at 1, why does the alphabet start
> with 'A', why do arrays
> start at 0? Because we just said made them so. You
> have a bijection
> between some things with intrinsic order and your
> symbols (or numbers
> or counting numbers or whatever) for manipulating
> that order, whatever
> is handy for the task.  0 is handy.
> 
> I can't really find a justification for preferring a
> given set of 
> indices for
> addressing things other than appealing to handiness.
> Counting and
> ordering are just entirely different concepts to me.
> 
> It's all pretty arbitrary and to call it "natural
> principle" is a bit of 
> an exaggeration.
> I have friends who the mere thought of a number
> scares them and throws 
> them into
> mental paralysis. So "natural principle" in this
> case may be better 
> described as the
> lore of mathematicians. Then again, depending on who
> you talk to, 0 is 
> an ordinal
> number, doh! But if I am going to choose some
> arbitrary theoretical 
> stance, I will
> choose the one that is handiest for the domain,
> computers.
> 
> Lee
> 
> Shaping wrote:
> 
> >> It's not just tailored more to how computers
> work. When it
> >> comes down to it, it makes as much intuitive
> sense as any
> >> other way. Starting from the origin, how far away
> is some
> >> thing? Giving you a spatial metaphor for working
> with items
> >> I would argue makes it easier to see in your head
> what you're
> >> doing. I can easily visualize grid space, but I
> can't easily
> >> visualize a jumble of objects that I've counted.
> >
> > Becareful not to confuse continuous measurement
> with discrete 
> > counting.  Both have there uses.  If you can
> count/order, do that 
> > because it is more basic than ruling/measuring on
> a continuous axis.  
> > Note the essential difference:
> > --------------------
> >    1      2     ...
> > 0.0   1.0    2.0 ...
> > --------------------
> >
> >>
> >> Counting makes sense to me for talking about the
> size of a
> >> collection, but really makes no intuitive sense
> to me elsewhere.
> >
> >
> > Then think "order" not "size", and clarity will
> return.
> >
> >> Now, maybe I have been programming too long and
> have built
> >> up a new set of intuitions,
> >
> >
> > Indeed, all of us, but these conditionings do not
> preclude realignment 
> > with natural principle, both in computer language
> and hardware 
> > structure (which is yet to happen).
> >
> >
> > Shaping
> >
> >
> 
> 


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Sports - Sign up for Fantasy Baseball. 
http://baseball.fantasysports.yahoo.com/




More information about the Slate mailing list