One of the most misused data structures is the humble map; hashmap, dictionary, hash table, etc.
It's a great data structure for quick storage and access of key value pairs. Unfortunately, because of its ease and availability, it becomes pervasive at jobs it has no business doing. The problem grows most visible in dynamically typed languages that make the map a first class citizen (Python, Ruby, Clojure, etc.), but it can creep up in any language.
Man… I thought this was going to be a proper rant about using maps where you should be using other things… No, it’s a make sure you type your function inputs rant…
I wasn’t trying to go into typing as much as using structs or objects when working with known data attributes. Sorry that it was a bit misleading.
The original actually went into using trees, sets, heaps, tries, etc., but it felt way too… ranty. After writing all that out, I realized that most of those other cases come up really infrequently, and that my biggest gripe was about not using structs or other pre-defined key container types. I thought it would be better to keep things short and focused.
Maybe I should re-write and publish a data structures edition.
I would like that! Very much!