in reply to What defines the choice of a Hash or an Array?

Let's look at this as a sort of a flow chart, to decide what our main data type is. I'm not going to go into when we'd use an array of arrays vs. an array of hashes, vs. a tied hash, etc.

*Note : if you can shift your indexes, you might be able to get away with this, but you won't access the indexes directly, which might confuse some people. Eg, if we're tracking years 1920-2000, we might index on (year - 1900). We can also handle floats this way, if we have a known precision, like with yesterdays's discussion of indexing on earthquake magnitude in Problems with defining hashes, or we could handle negative integers, etc.

  • Comment on Re: What defines the choice of a Hash or an Array?