4 ms·
It is just a hash map with a few common functions defined; hash maps are occasionally useful, but what is all the praise about? The mentioned "simple" bit is a
by defanor 3y ago
It is just a hash map with a few common functions defined; hash maps are occasionally useful, but what is all the praise about?
The mentioned "simple" bit is arguable: as a language's building block, a hash map is relatively complex and specific, since those can be built out of lists (or trees, though lists/arrays may be preferable for efficiency), which can be built out of pairs (product types, cons cells, tuples; unless going for that efficiency, though it can still be pretty efficient with trees). Maybe it is one of those "simple versus easy" mix-ups.
- rob74 3y agoWell yeah, it's "simple" (or easy) to use, definitely not simple to implement. But having an easy-to-use hashmap is par for the course for most newer languages - not only Ruby, but also PHP (associative arrays), JS (objects), Go (built-in map type) etc.