6 ms·
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 b
by ecshafer 5y ago
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.
- EamonnMR 5y agoWhen I was first taught Java in college I didn't find out about hash maps for a while because it was considered too advanced for beginners (ohh scary templates!)
- myphs 5y agoThis is quite interesting. I wonder, why this was decided to be too advanced. In my uni we teach it from the very beginning.
- pydry 5y agoPython switching all dicts to being ordered is my favorite new feature from the last five years. It's useful all over the damn place.
- rob74 5y agoHash 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.
- mypalmike 5y agoHash 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.
- benibela 5y agoBut the standard C++ std::unordered_map only came with C++11
- boardwaalk 5y agoEhh, 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.