mustache / spec

The Mustache spec.
MIT License
364 stars 71 forks source link

spec uses "hash" where no hashes are used #73

Closed Pomax closed 10 years ago

Pomax commented 10 years ago

http://mustache.github.io/mustache.5.html uses "hash" quite a few times to refer to key/value objects. As these objects have nothing to do with hashing, it's probably well worth rephrasing the spec to call these things "key/value pairs" instead of hashes.

mauris commented 10 years ago

The word "hash" used in this context refers to associative arrays (or objects in JavaScript) and the full word is "Hash table"

Pomax commented 10 years ago

I know, and that's incorrect term use. Associate arrays are not hashes, and hash tables are very specific things (i.e. hashing containers that internally store keys/value pairs in bins that are accessed through the hash digest of the key for fast retrieval of individual entries in large sets). Using the term for the mustache spec is a bit weird, as the language mustache came from doesn't have either of those things: in JS, the structures shown are plain key/value pair objects (they're not arrays, and objects don't require hashing codes for keys), so using the word "hash" in the spec is basically implying this spec is tied to a different language (one where the term "hash" means something, like perl)

bobthecow commented 10 years ago

@Pomax PHP calls 'em "associative arrays". Ruby calls them "hashes". Python calls them "dictionaries". JavaScript calls them "objects". Mustache was born as a Ruby library, so if we have to pick one, we might as well pick "hash".

mauris commented 10 years ago

@bobthecow I guess the shortest word won!

Pomax commented 10 years ago

fair enough.