[Ruby] Why is a dictionary called a dictionary in Python and the same thing is a called a hash in Ruby ?
1 Like
Different creators, different names. Naming things is one of the hardest things in Computer Science. At it’s heart, a dictionary in Python is a hash table.
And a hash table in Ruby is a dictionary ?
A hash table in Ruby is a hash table. A hash table is a way to associate pairs of values, commonly called key-value pairs.
Then JavaScript had to call them “objects” and things started to get weird…
2 Likes
There’s also hash map, which would be the same as a hash table.
Honestly I wouldn’t worry too much about the names, I rather focus on knowing the differences maps and dictionaries.
Totally agree with you