Re:An efficient way to make hash maps with insertion ordering
by ecshafer on Thursday July 01, 2021 @09:47AM
(#27698995)
This is a weird article. It creates the idea that hash maps are uncommon? surprising? I am not really sure. Then makes the claim that you would expect them to be ordered by insertion order, and not just randomly which is the common usage of hash maps. Ordered Hash Maps exist, and isn't a insertion order hash map, basically just a list? But Hash Maps are so common and used absolutely everywhere its almost like its aiming at people who have used them but never any other data structures.
[ Parent
| on HN ]
Re:An efficient way to make hash maps with insertion ordering
by pydry on Thursday July 01, 2021 @11:03AM
(#27699755)
Python switching all dicts to being ordered is my favorite new feature from the last five years.
It's useful all over the damn place.
Re:An efficient way to make hash maps with insertion ordering
by rob74 on Thursday July 01, 2021 @11:33AM
(#27700189)
Hash maps are a fairly recent addition to the standard data structures "library", because they are relatively performance-intensive. They are of course very useful and therefore commonplace now, but I think that only came about after the rise of dynamic languages which have built-in hash maps (Javascript objects, PHP "associative arrays" etc.). So nowadays any new programming language which wants to attract web developers (e.g. Go) needs a built-in hash map.
Re:An efficient way to make hash maps with insertion ordering
by boardwaalk on Thursday July 01, 2021 @03:51PM
(#27703774)
Ehh, hash tables were invented in the 50s and were and are used wherever they are useful. I’m pretty sure a running joke is that every decently sized C program contains a half dozen hash table implementations. They’re not recent.
Re:An efficient way to make hash maps with insertion ordering
by mypalmike on Thursday July 01, 2021 @12:52PM
(#27701234)
Hash maps have been commonly used in C since just about forever.
"isn't a insertion order hash map, basically just a list?"
No. They are different in the computational complexity of random access operations.
Re:An efficient way to make hash maps with insertion ordering
by benibela on Thursday July 01, 2021 @06:44PM
(#27705806)
But the standard C++ std::unordered_map only came with C++11