<?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: Comparable vs. Comparator</title>
	<atom:link href="http://www.javablogging.com/comparable-vs-comparator/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javablogging.com/comparable-vs-comparator/</link>
	<description>Tracking surprises, features and bugs</description>
	<lastBuildDate>Sun, 05 Feb 2012 15:43:49 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Generic viagra cialis levitra cheap</title>
		<link>http://www.javablogging.com/comparable-vs-comparator/comment-page-1/#comment-16581</link>
		<dc:creator>Generic viagra cialis levitra cheap</dc:creator>
		<pubDate>Tue, 04 Oct 2011 14:08:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.javablogging.com/?p=522#comment-16581</guid>
		<description>hjjsfkbwbcmphhjoh, &lt;a href=&quot;http://arrogatemedical.com/GenericViagra.html&quot; rel=&quot;nofollow&quot;&gt;Generic viagra without prescription&lt;/a&gt;, pBCfzxF, [url=http://arrogatemedical.com/GenericViagra.html]Buy viagra online[/url], nENdARF, http://arrogatemedical.com/GenericViagra.html Is maxoderm better than viagra, lgFBxRg.</description>
		<content:encoded><![CDATA[<p>hjjsfkbwbcmphhjoh, <a href="http://arrogatemedical.com/GenericViagra.html" rel="nofollow">Generic viagra without prescription</a>, pBCfzxF, [url=http://arrogatemedical.com/GenericViagra.html]Buy viagra online[/url], nENdARF, <a href="http://arrogatemedical.com/GenericViagra.html" rel="nofollow">http://arrogatemedical.com/GenericViagra.html</a> Is maxoderm better than viagra, lgFBxRg.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Viagra</title>
		<link>http://www.javablogging.com/comparable-vs-comparator/comment-page-1/#comment-12002</link>
		<dc:creator>Viagra</dc:creator>
		<pubDate>Sat, 16 Jul 2011 02:25:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.javablogging.com/?p=522#comment-12002</guid>
		<description>, &lt;a href=&quot;http://www.viagraonlinews.com/&quot; rel=&quot;nofollow&quot;&gt;Viagra online&lt;/a&gt;,  &gt;:PPP, &lt;a href=&quot;http://www.viagraonlinehq.co.uk/&quot; rel=&quot;nofollow&quot;&gt;Generic viagra&lt;/a&gt;,  hwdve, &lt;a href=&quot;http://www.usaonlineviagra.com/&quot; rel=&quot;nofollow&quot;&gt;Viagra&lt;/a&gt;,  8-D,</description>
		<content:encoded><![CDATA[<p>, <a href="http://www.viagraonlinews.com/" rel="nofollow">Viagra online</a>,  &gt;:PPP, <a href="http://www.viagraonlinehq.co.uk/" rel="nofollow">Generic viagra</a>,  hwdve, <a href="http://www.usaonlineviagra.com/" rel="nofollow">Viagra</a>,  8-D,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bad credit loans</title>
		<link>http://www.javablogging.com/comparable-vs-comparator/comment-page-1/#comment-12001</link>
		<dc:creator>Bad credit loans</dc:creator>
		<pubDate>Sat, 16 Jul 2011 02:24:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.javablogging.com/?p=522#comment-12001</guid>
		<description>, &lt;a href=&quot;http://www.usamedsws.com/&quot; rel=&quot;nofollow&quot;&gt;Viagra&lt;/a&gt;,  5606, &lt;a href=&quot;http://www.zmedswww.com/comprar-viagra-spain.html&quot; rel=&quot;nofollow&quot;&gt;Viagra&lt;/a&gt;,  &gt;:]]], &lt;a href=&quot;http://www.greatestdealsws.com/paydayloan.html&quot; rel=&quot;nofollow&quot;&gt;Personal loan&lt;/a&gt;,  8OOO,</description>
		<content:encoded><![CDATA[<p>, <a href="http://www.usamedsws.com/" rel="nofollow">Viagra</a>,  5606, <a href="http://www.zmedswww.com/comprar-viagra-spain.html" rel="nofollow">Viagra</a>,  &gt;:]]], <a href="http://www.greatestdealsws.com/paydayloan.html" rel="nofollow">Personal loan</a>,  8OOO,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pmrhtqxcg</title>
		<link>http://www.javablogging.com/comparable-vs-comparator/comment-page-1/#comment-11951</link>
		<dc:creator>pmrhtqxcg</dc:creator>
		<pubDate>Fri, 15 Jul 2011 03:14:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.javablogging.com/?p=522#comment-11951</guid>
		<description>kJZXoB  &lt;a href=&quot;http://bftywaakaljm.com/&quot; rel=&quot;nofollow&quot;&gt;bftywaakaljm&lt;/a&gt;, [url=http://mierrbhvjrpm.com/]mierrbhvjrpm[/url], [link=http://mafjqwtdshlo.com/]mafjqwtdshlo[/link], http://nkdvrnuhxcdb.com/</description>
		<content:encoded><![CDATA[<p>kJZXoB  <a href="http://bftywaakaljm.com/" rel="nofollow">bftywaakaljm</a>, [url=http://mierrbhvjrpm.com/]mierrbhvjrpm[/url], [link=http://mafjqwtdshlo.com/]mafjqwtdshlo[/link], <a href="http://nkdvrnuhxcdb.com/" rel="nofollow">http://nkdvrnuhxcdb.com/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Swoneequinott</title>
		<link>http://www.javablogging.com/comparable-vs-comparator/comment-page-1/#comment-11797</link>
		<dc:creator>Swoneequinott</dc:creator>
		<pubDate>Wed, 06 Jul 2011 11:25:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.javablogging.com/?p=522#comment-11797</guid>
		<description>Head Profile Sketches Medicine Stock  &lt;a href=&quot;http://www.3rdhalo.com/&quot; rel=&quot;nofollow&quot;&gt;cheap ambien without prescription&lt;/a&gt; Ambien can be prescribed to act as an anti-convulsant or muscle relaxant. http://www.3rdhalo.com/ - ambien online no prescription</description>
		<content:encoded><![CDATA[<p>Head Profile Sketches Medicine Stock  <a href="http://www.3rdhalo.com/" rel="nofollow">cheap ambien without prescription</a> Ambien can be prescribed to act as an anti-convulsant or muscle relaxant. <a href="http://www.3rdhalo.com/" rel="nofollow">http://www.3rdhalo.com/</a> &#8211; ambien online no prescription</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: miami fl lawyer</title>
		<link>http://www.javablogging.com/comparable-vs-comparator/comment-page-1/#comment-3271</link>
		<dc:creator>miami fl lawyer</dc:creator>
		<pubDate>Sun, 11 Jul 2010 01:46:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.javablogging.com/?p=522#comment-3271</guid>
		<description>Looking forward to finally finishing my research, great post!</description>
		<content:encoded><![CDATA[<p>Looking forward to finally finishing my research, great post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WP Themes</title>
		<link>http://www.javablogging.com/comparable-vs-comparator/comment-page-1/#comment-1929</link>
		<dc:creator>WP Themes</dc:creator>
		<pubDate>Thu, 18 Mar 2010 03:23:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.javablogging.com/?p=522#comment-1929</guid>
		<description>Genial brief and this mail helped me alot in my college assignement. Thank you on your information.</description>
		<content:encoded><![CDATA[<p>Genial brief and this mail helped me alot in my college assignement. Thank you on your information.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pravin Jain</title>
		<link>http://www.javablogging.com/comparable-vs-comparator/comment-page-1/#comment-363</link>
		<dc:creator>Pravin Jain</dc:creator>
		<pubDate>Fri, 11 Sep 2009 12:01:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.javablogging.com/?p=522#comment-363</guid>
		<description>Comparable should be implemented to define natural ordering for Objects of a class, and every class may not have natural ordering.
Here for example if the SelectablePerson had an id field, then that could be used for natural ordering, since we would consider two SelectablePerson to be equal whenever their ids match. In all other cases, one should use a Comparator.</description>
		<content:encoded><![CDATA[<p>Comparable should be implemented to define natural ordering for Objects of a class, and every class may not have natural ordering.<br />
Here for example if the SelectablePerson had an id field, then that could be used for natural ordering, since we would consider two SelectablePerson to be equal whenever their ids match. In all other cases, one should use a Comparator.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jbisotti</title>
		<link>http://www.javablogging.com/comparable-vs-comparator/comment-page-1/#comment-312</link>
		<dc:creator>jbisotti</dc:creator>
		<pubDate>Tue, 01 Sep 2009 14:57:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.javablogging.com/?p=522#comment-312</guid>
		<description>&quot;The problem was not caused by ‘not reading Javadoc’ or faulty implementation of equals() but by a bad design decision of implementing Comparable instead of using a Comparator. You are also right that adding a field to SelectablePerson class could remove that bug, but it would only complicate the design and mask the real issue.&quot;

Really? IMHO, you are the one missing the main point. Regardless of if the design decision was a good one or not, the implementation is poor.  And it most definitely is not masking the real issue; it&#039;s exposing it.

Per your argument, you would blame the following on the Set interface, or the &quot;design decision&quot; to use a Set implementation:

final SelectablePerson p1 = new SelectablePerson( &quot;smith&quot; );

final SelectablePerson p2 = new SelectablePerson( &quot;smith&quot; );

final Set people = new HashSet();

people.add( p1 );
people.add( p2 );

// Fails because there&#039;s only one element in the Set
assertEquals( 2, people.size() );</description>
		<content:encoded><![CDATA[<p>&#8220;The problem was not caused by ‘not reading Javadoc’ or faulty implementation of equals() but by a bad design decision of implementing Comparable instead of using a Comparator. You are also right that adding a field to SelectablePerson class could remove that bug, but it would only complicate the design and mask the real issue.&#8221;</p>
<p>Really? IMHO, you are the one missing the main point. Regardless of if the design decision was a good one or not, the implementation is poor.  And it most definitely is not masking the real issue; it&#8217;s exposing it.</p>
<p>Per your argument, you would blame the following on the Set interface, or the &#8220;design decision&#8221; to use a Set implementation:</p>
<p>final SelectablePerson p1 = new SelectablePerson( &#8220;smith&#8221; );</p>
<p>final SelectablePerson p2 = new SelectablePerson( &#8220;smith&#8221; );</p>
<p>final Set people = new HashSet();</p>
<p>people.add( p1 );<br />
people.add( p2 );</p>
<p>// Fails because there&#8217;s only one element in the Set<br />
assertEquals( 2, people.size() );</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sakuraba</title>
		<link>http://www.javablogging.com/comparable-vs-comparator/comment-page-1/#comment-311</link>
		<dc:creator>Sakuraba</dc:creator>
		<pubDate>Tue, 01 Sep 2009 07:04:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.javablogging.com/?p=522#comment-311</guid>
		<description>Wouldn&#039;t all of this be sorted out if equals/hashcode were implemented correctly? Regardless of Comparable/Comparator?</description>
		<content:encoded><![CDATA[<p>Wouldn&#8217;t all of this be sorted out if equals/hashcode were implemented correctly? Regardless of Comparable/Comparator?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

