Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

djberg96 (2603)

djberg96
  (email not shown publicly)

Journal of djberg96 (2603)

Thursday November 07, 2002
09:52 AM

Hardcore C programmers

[ #8818 ]
I was trying to figure out the best way to implement a form of split() in pure C last night, so I wandered in the #C chatroom on IRC.

I ended up chatting with a guy named Philip, who has apparently been coding in C for 20 years, has a vast library here, thinks C is the easiest language around, and has general disdain for anything that isn't compiled into bytecode. He especially didn't like Perl.

One of the reasons he didn't like Perl is the confusion he felt it created with regards to the terms "hash" and "associative array". His claim was that they're really two different things, although I could never get him to explain what exactly the difference was.

So, one of my goals for the week is to find out exactly what the difference is. :)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • The difference is that they are exactly the same.

    associative array

    <programming> An array where the indices are not just integers but may be arbitrary strings.

    hash

    3. The preferred term for a Perl associative array.

    -- FOLDOC [ic.ac.uk]

  • They really are different. If nothing else, the two terms are meaningful at different levels of abstraction.

    An associative array is a source language level concept. It means an array which is indexed by arbitrary, unordered values, typically (but not necessarily) strings.

    A hash table is a data structure in which keys are crunched through a hashing function in order to get the actual index used in the table. This is to handle both the unordered-ness and the sparseness of keys.

    Associative arrays need no
    • An associative array is a source language level concept. It means an array which is indexed by arbitrary, unordered values, typically (but not necessarily) strings.

      A hash table is a data structure in which keys are crunched through a hashing function in order to get the actual index used in the table. This is to handle both the unordered-ness and the sparseness of keys.

      Correct me if I'm wrong, but to add to this I believe important distinction that a hash value is a number created by a function which ef