<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Is Using Hash Tables a Good Thing?</title>
	<atom:link href="http://coliveira.net/software/is-using-hash-tables-a-good-thing/feed/" rel="self" type="application/rss+xml" />
	<link>http://coliveira.net/software/is-using-hash-tables-a-good-thing/</link>
	<description>Some Ideas by Carlos Oliveira</description>
	<lastBuildDate>Sat, 20 Feb 2010 20:19:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: coliveira</title>
		<link>http://coliveira.net/software/is-using-hash-tables-a-good-thing/comment-page-1/#comment-12</link>
		<dc:creator>coliveira</dc:creator>
		<pubDate>Thu, 20 Nov 2008 15:48:22 +0000</pubDate>
		<guid isPermaLink="false">http://coliveira.net/?p=45#comment-12</guid>
		<description>@ Chase,

Yes, you are right in general. But I am just describing the situation when you are mapping an object (not a string or integer) to another. You already know what object you are looking for, so there is no need to do a search for that object in the vector.

Again I am not saying that we shouldn&#039;t use hash tables, but describing an alternative and thinking that they might be overused in current code.</description>
		<content:encoded><![CDATA[<p>@ Chase,</p>
<p>Yes, you are right in general. But I am just describing the situation when you are mapping an object (not a string or integer) to another. You already know what object you are looking for, so there is no need to do a search for that object in the vector.</p>
<p>Again I am not saying that we shouldn&#8217;t use hash tables, but describing an alternative and thinking that they might be overused in current code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: coliveira</title>
		<link>http://coliveira.net/software/is-using-hash-tables-a-good-thing/comment-page-1/#comment-11</link>
		<dc:creator>coliveira</dc:creator>
		<pubDate>Thu, 20 Nov 2008 14:43:56 +0000</pubDate>
		<guid isPermaLink="false">http://coliveira.net/?p=45#comment-11</guid>
		<description>@ Henrik,

I agree that hash maps have good performance, and I am glad they exist. I am just talking against the overuse of a good feature. A problem that I see is that we sometimes add indirection to code when it is not necessary.

The other problem I see is that data uses should be located as close as possible to other related data. Hash tables make it easy to spread data over your code, so
we need to be careful to identify when this is just making your code more complicated.</description>
		<content:encoded><![CDATA[<p>@ Henrik,</p>
<p>I agree that hash maps have good performance, and I am glad they exist. I am just talking against the overuse of a good feature. A problem that I see is that we sometimes add indirection to code when it is not necessary.</p>
<p>The other problem I see is that data uses should be located as close as possible to other related data. Hash tables make it easy to spread data over your code, so<br />
we need to be careful to identify when this is just making your code more complicated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chase Saunders</title>
		<link>http://coliveira.net/software/is-using-hash-tables-a-good-thing/comment-page-1/#comment-10</link>
		<dc:creator>Chase Saunders</dc:creator>
		<pubDate>Thu, 20 Nov 2008 14:26:48 +0000</pubDate>
		<guid isPermaLink="false">http://coliveira.net/?p=45#comment-10</guid>
		<description>If I understand the data structure you&#039;re proposing, it&#039;s as complicated as a hash table and less efficient.    It&#039;s only a constant time lookup if you&#039;re in some sort of special case where you can calculate the index in T1 first in order to get the associated T2, or where you are iterating through all values.  &quot;Calculating the index&quot; should ring a bell, in this context - it&#039;s what hashing provides general solution for.  But I don&#039;t see you offering that...  in the general case, you&#039;ll have to perform a binary search on the T1 vector - O(Lg(N)) - before you can get your T2 element in constant time.</description>
		<content:encoded><![CDATA[<p>If I understand the data structure you&#8217;re proposing, it&#8217;s as complicated as a hash table and less efficient.    It&#8217;s only a constant time lookup if you&#8217;re in some sort of special case where you can calculate the index in T1 first in order to get the associated T2, or where you are iterating through all values.  &#8220;Calculating the index&#8221; should ring a bell, in this context &#8211; it&#8217;s what hashing provides general solution for.  But I don&#8217;t see you offering that&#8230;  in the general case, you&#8217;ll have to perform a binary search on the T1 vector &#8211; O(Lg(N)) &#8211; before you can get your T2 element in constant time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tassos Bassoukos</title>
		<link>http://coliveira.net/software/is-using-hash-tables-a-good-thing/comment-page-1/#comment-9</link>
		<dc:creator>Tassos Bassoukos</dc:creator>
		<pubDate>Thu, 20 Nov 2008 14:07:50 +0000</pubDate>
		<guid isPermaLink="false">http://coliveira.net/?p=45#comment-9</guid>
		<description>Your attitude reminds me of Beating the Averages (http://www.paulgraham.com/avg.html ), specifically the part about Blub. If you haven&#039;t read it, please do so, it will be enlightening.</description>
		<content:encoded><![CDATA[<p>Your attitude reminds me of Beating the Averages (<a href="http://www.paulgraham.com/avg.html" rel="nofollow">http://www.paulgraham.com/avg.html</a> ), specifically the part about Blub. If you haven&#8217;t read it, please do so, it will be enlightening.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henrik</title>
		<link>http://coliveira.net/software/is-using-hash-tables-a-good-thing/comment-page-1/#comment-8</link>
		<dc:creator>Henrik</dc:creator>
		<pubDate>Thu, 20 Nov 2008 12:17:36 +0000</pubDate>
		<guid isPermaLink="false">http://coliveira.net/?p=45#comment-8</guid>
		<description>have you heard of decoupling? it&#039;s a useful design principle.

The reason why maps are used so frequently is because the are very convenient and almost never the source of peformance issues.

premature optimization is the root of all evil.</description>
		<content:encoded><![CDATA[<p>have you heard of decoupling? it&#8217;s a useful design principle.</p>
<p>The reason why maps are used so frequently is because the are very convenient and almost never the source of peformance issues.</p>
<p>premature optimization is the root of all evil.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Artur</title>
		<link>http://coliveira.net/software/is-using-hash-tables-a-good-thing/comment-page-1/#comment-7</link>
		<dc:creator>Artur</dc:creator>
		<pubDate>Thu, 20 Nov 2008 12:13:56 +0000</pubDate>
		<guid isPermaLink="false">http://coliveira.net/?p=45#comment-7</guid>
		<description>Hashtables are mostly used for caches. 

Imagine small DNS server, which has to answer many domain-&gt;ip requests. How do you plan to have fast lookup of already resolved entries by name without using some kind of dictionary ?

Second cache usage is database frontend layer - instead of going for the same data over and over to database, you can cache it on application level. Again, some kind of map is very helpful here.

&quot;All programming is an exercise in caching&quot;. And if you have sparse domain, maps/dictionaries are the right tool.</description>
		<content:encoded><![CDATA[<p>Hashtables are mostly used for caches. </p>
<p>Imagine small DNS server, which has to answer many domain-&gt;ip requests. How do you plan to have fast lookup of already resolved entries by name without using some kind of dictionary ?</p>
<p>Second cache usage is database frontend layer &#8211; instead of going for the same data over and over to database, you can cache it on application level. Again, some kind of map is very helpful here.</p>
<p>&#8220;All programming is an exercise in caching&#8221;. And if you have sparse domain, maps/dictionaries are the right tool.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
