<?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: Implementing equals()</title>
	<atom:link href="http://henko.net/imperfection/implementing-equals/feed/" rel="self" type="application/rss+xml" />
	<link>http://henko.net/imperfection/implementing-equals/</link>
	<description>Home of a human being and software developer</description>
	<lastBuildDate>Sun, 27 Nov 2011 18:38:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Henrik Jernevad</title>
		<link>http://henko.net/imperfection/implementing-equals/comment-page-1/#comment-46232</link>
		<dc:creator>Henrik Jernevad</dc:creator>
		<pubDate>Mon, 19 Apr 2010 19:25:47 +0000</pubDate>
		<guid isPermaLink="false">http://henko.net/software-engineering/implementing-equals/#comment-46232</guid>
		<description>&lt;p&gt;Hi Daniel, thanks for commenting! (And sorry for a late response.)&lt;/p&gt;

&lt;p&gt;That&#039;s a very good example you provided, and I agree with you.&lt;/p&gt;

&lt;p&gt;It reminds me of discussions about what type of matrix multiplication should be used by the * operator (for languages which support operator overloading). One solutions is simply not to use the * operator at all, but provide different methods for different types of multiplication. Maybe the same principle could be used here?&lt;/p&gt;

&lt;p&gt;Or maybe Set and SortedSet simply should be two different classes? Say, Set and List. Each with their own definition of equality.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Daniel, thanks for commenting! (And sorry for a late response.)</p>

<p>That&#8217;s a very good example you provided, and I agree with you.</p>

<p>It reminds me of discussions about what type of matrix multiplication should be used by the * operator (for languages which support operator overloading). One solutions is simply not to use the * operator at all, but provide different methods for different types of multiplication. Maybe the same principle could be used here?</p>

<p>Or maybe Set and SortedSet simply should be two different classes? Say, Set and List. Each with their own definition of equality.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://henko.net/imperfection/implementing-equals/comment-page-1/#comment-45581</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Sat, 10 Apr 2010 01:17:04 +0000</pubDate>
		<guid isPermaLink="false">http://henko.net/software-engineering/implementing-equals/#comment-45581</guid>
		<description>&lt;p&gt;And of course one, somewhat awkward, way of achieving pluggable equality checks that is useful in some cases is to use a wrapper that defines equals/hashcode appropriately.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>And of course one, somewhat awkward, way of achieving pluggable equality checks that is useful in some cases is to use a wrapper that defines equals/hashcode appropriately.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://henko.net/imperfection/implementing-equals/comment-page-1/#comment-45580</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Sat, 10 Apr 2010 01:10:28 +0000</pubDate>
		<guid isPermaLink="false">http://henko.net/software-engineering/implementing-equals/#comment-45580</guid>
		<description>&lt;p&gt;Your argument makes sense, but there are still issues. For example, consider&lt;/p&gt;

&lt;p&gt;Comparator desc = ... // Sort descending
SortedSet ascending = new TreeSet ();
ascending.addAll (Arrays.asList(&quot;a&quot;,&quot;b&quot;));
SortedSet descending = new TreeSet (desc);
descending.addAll (ascending);
System.out.println (ascending.equals (descending));&lt;/p&gt;

&lt;p&gt;These sets are equal, as required by the contract of the Set interface, but this may not be what you want when comparing SortedSets.&lt;/p&gt;

&lt;p&gt;Sometimes it would be useful to have pluggable equality checks (analogously to what Comparator does for comparisons).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Your argument makes sense, but there are still issues. For example, consider</p>

<p>Comparator desc = &#8230; // Sort descending
SortedSet ascending = new TreeSet ();
ascending.addAll (Arrays.asList(&#8220;a&#8221;,&#8221;b&#8221;));
SortedSet descending = new TreeSet (desc);
descending.addAll (ascending);
System.out.println (ascending.equals (descending));</p>

<p>These sets are equal, as required by the contract of the Set interface, but this may not be what you want when comparing SortedSets.</p>

<p>Sometimes it would be useful to have pluggable equality checks (analogously to what Comparator does for comparisons).</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Loriel</title>
		<link>http://henko.net/imperfection/implementing-equals/comment-page-1/#comment-2</link>
		<dc:creator>Loriel</dc:creator>
		<pubDate>Sun, 28 May 2006 05:16:12 +0000</pubDate>
		<guid isPermaLink="false">http://henko.net/software-engineering/implementing-equals/#comment-2</guid>
		<description>&lt;p&gt;Du övertygade mig nästan! =) Men jag har fortfarande känslan av att det borde finnas undantag... Jag ska fundera på det mer någon gång när jag får tid...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Du övertygade mig nästan! =) Men jag har fortfarande känslan av att det borde finnas undantag&#8230; Jag ska fundera på det mer någon gång när jag får tid&#8230;</p>]]></content:encoded>
	</item>
</channel>
</rss>

