Arrays: new and old keys, i

Mark Brownell gizmotron at earthlink.net
Sat Sep 13 04:30:52 EDT 2008



>Subject: Re: Arrays: new and old keys, i
>
>Thank you all, for this discussion.  Really.  It was more informative  
>than the release notes could even hope to be.  The exemplars of why  
>the new array features were so obviously useful helped me a lot in  
>exactly one way: I have no idea what you who promote these ``new''  
>features are on about.  Opaque doesn't begin to describe my  
>appreciation of your views on these ``new'' features.  Admittedly, I  
>have only been programming in everything from machine code through  
>every passing fad since the 1960s, so I may be either dated or  
>stunned.  But, really, I just don't get it.  Again, I ask, what have  
>we gained by the ``new'' array features, besides more brackets?   
>Setting fred[z] to empty does not seem to me to be a major  
>advancement.  Or, at least not one that is at best a trivial change.
>

I have been using these numerical versions for more than 10 years in Director. They are second nature to me. They are better containers than the two dimensional hash table type that were the old versions. They are really three dimensional. I prefer to use numbers because I generally know the structure of my data because I knew in advance that I could store the data in this numerical format. I like them, I use them.

As an XML it would look like this kind of storage:

<1>
 <1>http://www.slickers.com</1>
 <2>A website about rain slickers</2>
 <3>Types of Rain Coats</3>
   <1>Black Marauder</1>
   <2>Road Warrior</2>
   <3>The Mel Gibson</3>
   <4>The Bruce Lee</4>
    <1>Coats For Girls</1>
    <2>Coats For Under 12 Boys</2>
 <4>Types of Leather Underwear</4>
</1>

Notice that it is not well formed.

This is better for XML:

   <4>
    <type>The Bruce Lee</type>
    <1>Coats For Girls</1>
    <2>Coats For Under 12 Boys</2>
   </4>

   <4 type="The Bruce Lee">
     <1>Coats For Girls</1>
     <2>Coats For Under 12 Boys</2>
   </4>

Dimension allows me to associate meaning by the code that uses the data and not the data keys meaning. I do it this way in order to find/store sub data of sub data. It's more about convenient locations for me than of meaningful relational human readable storage.

My two cents, good luck.
 
 



More information about the use-livecode mailing list