Hashtable Should Be Deprecated

The “Hashtable” has always been a thorn in my side. Well not the class itself, but the people who used it all the time instead of “HashMap”. “HashMap” is the god damn standard implementation. If you really need a synchronized Map, you have to be anyway extremely carefull what you’re doing.

Now, since Java 5.0, there is a better thread-safe implementation of an Map, called “ConcurrentHashMap” in the java.util.concurrent-package. It is way better than the “Hashtable”, because it doesn’t just block on every operation. It uses smart algorithms to lock only if really needed.

So in my opinion, the “Hashtable” doesn’t have any great use anymore. So I think “Hashtable” should be marked as deprecated.

One thought on “Hashtable Should Be Deprecated

Leave a Reply

Your email address will not be published. Required fields are marked *