From: Chad Perrin Date: 2006-07-30T04:28:07+09:00 Subject: 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