The best name for dictionaries

I am developing a programming language, so I thought a lot about what the basic types are called.

"Dictionary" seems like a bad name for dictionaries. They are not organized lists of words with their definitions; they do not deal with words, they have no definitions, and they are not lists. The only vague connection they have with the word “dictionary” is that you perform a “search” in the same way as with a paper dictionary (which is also a good argument for calling their “phone books”).

"HashTable" describes an implementation that may change.

An "associative array" (from JavaScript) gets points because an "associative" is a good adjective for what it does, but it loses points, because an "array" also describes an implementation, and worse, it describes it inaccurately.

A key-value pair seems to be the most accurate, but too long to be useful (do you really want to type a KeyValuePairSet every time?).

If we call the key / value pair an association, we get an AssociationSet. This is the best for me, but does not jump on me as the correct answer; it is still long, and the “set” still feels a little wrong. "AssociationList" is worse ("list" implies an order that is not). I only looked briefly at the "Associations", but it sounds more like something that I would call an instance, not a class. "RelationSet" and "PairSet" are shorter, but less descriptive (none of them reflects the fact that it is a one-way key related to the value, the value for the key does not make sense in the context of dictionaries).

What ideas are better for dictionaries?

+3
14

""?

.

+21

- . , , , " heap" " queue" , . / .

, "" ( ) "" (, "-", , ).

Java map" ( " dictionary" - ​​, , , , .)

"" , .

+17

, "" , "" , ( " " ).

?

+2

, .

, - . , , . , . . , (http://en.wikipedia.org/wiki/Database_catalog), , - .

+2

, "-", . ? , , , - , -, - - .

, , (, Java Map, , HashMap TreeMap), , "", , .

+1

Map , .

Table, Lua.

+1

Python .

, , "", . . , - __getitem__() a mapping, , list.

, ( ):

: (, dict) __getitem__().

, , , .

+1

AssociationCloud

MapCloud

, . Nebulous.

+1

"" ? - , , , .... , .

, , / . , , , . , Rack? IndexedBag? KeyPairStash?

0

, Perl, . # ., , . . 2 . < & GT;

[]

. , . , , , , . . , . , . . . . , .

. , , , , .

, . , , .

, .

0

, - "" "KeyedIndex", "KeyIndex"...

: haha DIYIndex! , , ?

0

, ... - ASSOCIATIVE , , , SENSE.... , AssociateKVMap.... .... ,

0

.

Assoc
Array
Dict
Hash
Index
KeyValue
Map
Table

.

NSMutableDictionary
hash_map
0

, . KeyValuePairCollection.

-1

Source: https://habr.com/ru/post/1718083/


All Articles