• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why is Hashtable spelled with a small "t" ?  RSS feed

 
Jerome Pacleb
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you think java.util.Hashtable is spelled with a small "t"?
[ September 15, 2006: Message edited by: Jerome Pacleb ]
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because the person who invented it liked to spell it that way....? :roll:
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hash ... to chop up.
Table .. lookup table.
Map ... one key == one val
Set ... one, and only one of each
Tree ... gets you fast lookup

These names, I am sure there are others - my head spins at all of them - are sometimes put together as effective tools for keeping data during program run.

Whoever the author, I am sure they knew the naming rules. Oh yes, add list and vector to the above. Each has it's useful place in code, each could be capitalized, then added to the list above.

 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would guess that the person who named Hashtable thought of it as one word. While the person who named HashMap thought of it as two. The concept of a hashtable (or hash table) predates Java, and it's ultimately a toss-up whether you think of it as one word, or two. However, after the Hashtable class was first defined, they expanded on the conecpt, and the collections framework was developed. Since (later) there were several somewhat-related classes (HashMap, HashSet, LinkedHashSet) which shared the characteristic that they depended on the hashCode() method, it made more sense (later) to group the hash-related classes together with a common prefix (Hash-). Nowadays, the Hashtable class is best ignored as something that doesn[t really fit into the current paradigm. One can question the history here, but it's generally a waste of time. The designers of Java made some mistakes in the early days, and later they changed their minds. Hashtable is one of the old classes, which nowadays you're better off ignoring.
 
Jerome Pacleb
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow, that makes a lot of sense.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jim points out something funny, though. Hashtable and Object.hashCode() were, almost certainly, thought up at the same time, so why isn't it "hashcode()"? Messy, messy.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!