Re: Hash order bug?



On Sun, Jul 30, 2006 at 12:02:50AM +0900, Charles Hoffman wrote:

Which isn't to say anything about Javier specifically, I don't know him,
but in general, a review of one's Data Structures course may be in order
when this happens. But I think it happens to just about every
programmer at some point.

Oddly enough, I never made that assumption -- but I think that's because
I first learned about hashes/dictionaries/associative arrays by reading
something that explained up-front the fact that they're not ordered and,
more to the point, why they aren't ordered, in any particular manner
that makes immediate sense to the programmer.


course, the word "Dictionary" does, for most of us, bring to mind
something that's in alphabetical order, so maybe it was Microsoft's
fault for givig it a dumb name.

If so, you might want to have some words with Guido van Rossum about the
use of the term "dictionary" in Python. I'd probably be happier with
"lexicon" than "dictionary", but I like "hash" most of all.
"Associative array" is probably best, aside from the fact that it's WAY
too long to be comfortable for general use.


is largely agreed upon in computing. In other words, I'm with the "we
don't need an 'ordered hash'" crowd. I think that, besides slowing it
down, it goes against the very definition of what a hash is.

Agreed . . . but I wouldn't be opposed to a method that produces
alphabetized and/or asciibetized output, by key, from a hash.

--
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
"A script is what you give the actors. A program
is what you give the audience." - Larry Wall

.



Relevant Pages

  • Re: File Hashing
    ... Are you a programmer at all? ... definitely off-topic in the VB.NET newsgroup, ... Two different files will NEVER have the same hash value? ... SHA1 hash value? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Q: How to use non-builtin class as hash key?
    ... If the programmer ... wants to have non-equal objects to have same hash value, ... I assume you are asking why defining .eql? ... If two objects have the same hash value, this does not mean that they ...
    (comp.lang.ruby)
  • Re: MySQL PHP =@ symbol
    ... Their purpose is to get a programmer to take a second look at some code ... PHP emits a E_NOTICE or E_WARNING message whenever it fails to do ... In order to see if an element is available in a hash table, ...
    (comp.lang.php)
  • Re: C container and persistent library ?
    ... But finding it does take the fun out of writing it ... Rather you can call yourself a *good* programmer if you ... a good hash table that somebody else has already written. ...
    (comp.lang.c)