<?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"
	>
<channel>
	<title>Comments on: Programming Test</title>
	<atom:link href="http://blog.damianbrady.com.au/2008/06/02/programming-test/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.damianbrady.com.au/2008/06/02/programming-test/</link>
	<description>ramblings of a late 20s IT nerd / volleyball junkie / semi-professional drinker</description>
	<pubDate>Fri, 21 Nov 2008 16:03:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: A PROGRAMMING JOB INTERVIEW CHALLENGE #7 - COINS OF THE ROUND TABLE &#124; Dev102.com</title>
		<link>http://blog.damianbrady.com.au/2008/06/02/programming-test/#comment-316</link>
		<dc:creator>A PROGRAMMING JOB INTERVIEW CHALLENGE #7 - COINS OF THE ROUND TABLE &#124; Dev102.com</dc:creator>
		<pubDate>Mon, 09 Jun 2008 10:35:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.damianbrady.com.au/?p=63#comment-316</guid>
		<description>[...] Brady wrote a beautiful answer in his blog as did Ricky in his blog Crazy Pointer and Siddharth in his blog Some [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Brady wrote a beautiful answer in his blog as did Ricky in his blog Crazy Pointer and Siddharth in his blog Some [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damian Brady</title>
		<link>http://blog.damianbrady.com.au/2008/06/02/programming-test/#comment-315</link>
		<dc:creator>Damian Brady</dc:creator>
		<pubDate>Tue, 03 Jun 2008 02:19:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.damianbrady.com.au/?p=63#comment-315</guid>
		<description>You can't change the behaviour of the == operator in the Object class I don't think.  You might be able to with extension methods in .Net 3.0, but I doubt it - haven't tried it.

I meant that you can override the == operator (write your own definition) in any class you create and it will be called rather than the default Object behaviour.

Also, probably shouldn't have said C++.  I'm way too rusty on it and it looks like I'm a bit off with that suggestion (read: wrong).  Java might have been more appropriate - or any language where everything is considered an object.

My intention was to suggest that in language similar to C#, the == operator will return false for two separate non-primitives regardless of their actual value.</description>
		<content:encoded><![CDATA[<p>You can&#8217;t change the behaviour of the == operator in the Object class I don&#8217;t think.  You might be able to with extension methods in .Net 3.0, but I doubt it - haven&#8217;t tried it.</p>
<p>I meant that you can override the == operator (write your own definition) in any class you create and it will be called rather than the default Object behaviour.</p>
<p>Also, probably shouldn&#8217;t have said C++.  I&#8217;m way too rusty on it and it looks like I&#8217;m a bit off with that suggestion (read: wrong).  Java might have been more appropriate - or any language where everything is considered an object.</p>
<p>My intention was to suggest that in language similar to C#, the == operator will return false for two separate non-primitives regardless of their actual value.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://blog.damianbrady.com.au/2008/06/02/programming-test/#comment-314</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Tue, 03 Jun 2008 01:53:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.damianbrady.com.au/?p=63#comment-314</guid>
		<description>Can you override the == operator of the Object class?</description>
		<content:encoded><![CDATA[<p>Can you override the == operator of the Object class?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damian Brady</title>
		<link>http://blog.damianbrady.com.au/2008/06/02/programming-test/#comment-313</link>
		<dc:creator>Damian Brady</dc:creator>
		<pubDate>Mon, 02 Jun 2008 23:00:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.damianbrady.com.au/?p=63#comment-313</guid>
		<description>Fair point - I can't really think of an occasion where you don't know what type of object is going in a list.  Even if it needs to be reusable, just use generics.  Actually, since .Net 2.0, I don't think I've used ArrayList - the List generic does the same job and provides type safety.

That aside, use of the Equals function makes sense as long as you know what it means.  You get the same behaviour with C++.

Unless you've overridden the behaviour for a class, Equals() gives you value equality and == gives you reference equality.  For unboxed primitives, == will give the same answer as Equals.

Also, as a side note, you can actually override operators in C#: &lt;a href="http://msdn.microsoft.com/en-us/library/ms173147(VS.80).aspx" rel="nofollow"&gt;http://msdn.microsoft.com/en-us/library/ms173147(VS.80).aspx&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Fair point - I can&#8217;t really think of an occasion where you don&#8217;t know what type of object is going in a list.  Even if it needs to be reusable, just use generics.  Actually, since .Net 2.0, I don&#8217;t think I&#8217;ve used ArrayList - the List generic does the same job and provides type safety.</p>
<p>That aside, use of the Equals function makes sense as long as you know what it means.  You get the same behaviour with C++.</p>
<p>Unless you&#8217;ve overridden the behaviour for a class, Equals() gives you value equality and == gives you reference equality.  For unboxed primitives, == will give the same answer as Equals.</p>
<p>Also, as a side note, you can actually override operators in C#: <a href="http://msdn.microsoft.com/en-us/library/ms173147(VS.80).aspx" rel="nofollow"></a><a href="http://msdn.microsoft.com/en-us/library/ms173147" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms173147</a>(VS.80).aspx.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://blog.damianbrady.com.au/2008/06/02/programming-test/#comment-307</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Mon, 02 Jun 2008 15:55:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.damianbrady.com.au/?p=63#comment-307</guid>
		<description>Duh... and the lesson is - used typed containers unless you REALLY have a good reason. C# and its dumb operators which aren't virtual and can't be overridden and the less than obvious use of Equals() as a solution....</description>
		<content:encoded><![CDATA[<p>Duh&#8230; and the lesson is - used typed containers unless you REALLY have a good reason. C# and its dumb operators which aren&#8217;t virtual and can&#8217;t be overridden and the less than obvious use of Equals() as a solution&#8230;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.541 seconds -->
