<?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: C# 3.0:  Now with Categories!</title>
	<atom:link href="http://www.friday.com/bbum/2007/01/31/c-30-now-with-categories/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.friday.com/bbum/2007/01/31/c-30-now-with-categories/</link>
	<description>...so google can index my head.</description>
	<lastBuildDate>Fri, 19 Mar 2010 16:06:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ken Anderson</title>
		<link>http://www.friday.com/bbum/2007/01/31/c-30-now-with-categories/comment-page-1/#comment-69275</link>
		<dc:creator>Ken Anderson</dc:creator>
		<pubDate>Fri, 09 Feb 2007 22:46:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/2007/01/31/c-30-now-with-categories/#comment-69275</guid>
		<description>Bill, that bool return addObjectIfAbsent: method was way back in EOF 2.1 circa 1996 - I know, I found it! (or at least, was one of the finders).  I was working at Stratus Computer using OpenStep to build their call tracking system and it took me 3 days of stack and assembly debugging to figure it out...what a nightmare!</description>
		<content:encoded><![CDATA[<p>Bill, that bool return addObjectIfAbsent: method was way back in EOF 2.1 circa 1996 &#8211; I know, I found it! (or at least, was one of the finders).  I was working at Stratus Computer using OpenStep to build their call tracking system and it took me 3 days of stack and assembly debugging to figure it out&#8230;what a nightmare!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bbum&#8217;s weblog-o-mat &#187; Blog Archive &#187; C# 3.0 Categories Followup</title>
		<link>http://www.friday.com/bbum/2007/01/31/c-30-now-with-categories/comment-page-1/#comment-65730</link>
		<dc:creator>bbum&#8217;s weblog-o-mat &#187; Blog Archive &#187; C# 3.0 Categories Followup</dc:creator>
		<pubDate>Fri, 02 Feb 2007 06:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/2007/01/31/c-30-now-with-categories/#comment-65730</guid>
		<description>[...] A couple of days ago, I posted some observations and questions regarding C# 3.0&#8217;s extension methods. [...]</description>
		<content:encoded><![CDATA[<p>[...] A couple of days ago, I posted some observations and questions regarding C# 3.0&#8217;s extension methods. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jay Tuley</title>
		<link>http://www.friday.com/bbum/2007/01/31/c-30-now-with-categories/comment-page-1/#comment-65346</link>
		<dc:creator>Jay Tuley</dc:creator>
		<pubDate>Thu, 01 Feb 2007 05:38:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/2007/01/31/c-30-now-with-categories/#comment-65346</guid>
		<description>I&#039;m not sure what your point about the System namespace is. For starters, declaring an extension method in System would not be appropriate EVER, also the C# 3.0 spec says that extension methods have a precedences which seem to be help with the problems you are suggestion. The first precedence states that real instance methods take precedence over extension methods -- this may still cause the writer of the extension method trouble, however it&#039;s certainly less confusing then the opposite as illustrated in your web objects example. The other precedence is that inner namespaces take precedence over outer namespace -- so if someone else stupidly declares an extension method in system and it&#039;s imported, most likely my extension method with the same name is in the namespace i&#039;m using so it will have precedence and thus not cause me grief, but if it&#039;s not in my namespace and is just another assembly than it&#039;s ambiguous like Nicholas said and you&#039;ll probably get an error saying so from the compiler or runtime and you&#039;ll just have to reworking your use of the &quot;using&quot; keyword.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure what your point about the System namespace is. For starters, declaring an extension method in System would not be appropriate EVER, also the C# 3.0 spec says that extension methods have a precedences which seem to be help with the problems you are suggestion. The first precedence states that real instance methods take precedence over extension methods &#8212; this may still cause the writer of the extension method trouble, however it&#8217;s certainly less confusing then the opposite as illustrated in your web objects example. The other precedence is that inner namespaces take precedence over outer namespace &#8212; so if someone else stupidly declares an extension method in system and it&#8217;s imported, most likely my extension method with the same name is in the namespace i&#8217;m using so it will have precedence and thus not cause me grief, but if it&#8217;s not in my namespace and is just another assembly than it&#8217;s ambiguous like Nicholas said and you&#8217;ll probably get an error saying so from the compiler or runtime and you&#8217;ll just have to reworking your use of the &#8220;using&#8221; keyword.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicholas Paldino [.NET/C# MVP]</title>
		<link>http://www.friday.com/bbum/2007/01/31/c-30-now-with-categories/comment-page-1/#comment-65244</link>
		<dc:creator>Nicholas Paldino [.NET/C# MVP]</dc:creator>
		<pubDate>Wed, 31 Jan 2007 23:23:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/2007/01/31/c-30-now-with-categories/#comment-65244</guid>
		<description>There is nothing wrong per se with the nomenclature that you suggest: &lt;code&gt;public static class MyExtensions extends object {...}&lt;/code&gt;.  However, it does introduce some issues.  The first is that you are limiting the class to be nothing but extensions for object.  This might be fine for some people, but too many people would not want that kind of limitation on their classes.

Also, it should be noted that you do not need to have your class be declared as &lt;code&gt;static&lt;/code&gt; in order to use extension methods.  The only requirement for extension methods is that the method be static, and that it use the &lt;code&gt;this&lt;/code&gt; qualifier before the type declaration in the parameter list.  The &lt;code&gt;static&lt;/code&gt; keyword in a class declaration only tells the compiler to make sure that the type has no constructors, and no instance methods.

In the case of placing an extension method on &lt;code&gt;Object&lt;/code&gt; in the &lt;code&gt;System&lt;/code&gt; namespace, obviously, that&#039;s can be a huge issue.  However, it only occurs when you reference two assemblies that put the same extension method (meaning name and parameter list) in the same namespace and you use the &lt;code&gt;using&lt;/code&gt; declaration in the file.

In the case of a clash (either with an already existing instance method, or another extension method from another namespace), the compilation should fail, citing that the method is ambiguous (although I have to check the spec for this to be sure).

Remember, extension methods are still static methods, so you can still call them in the standard way.  They are really just compiler magic/syntactic sugar which was implemented to help make LINQ possible (querying over objects).  More specifically, the &lt;code&gt;IEnumerable&lt;/code&gt; interface is what is targeted in order to help implement this functionality (along with lambda expressions, anonymous types, and type inference, i.e. the &lt;code&gt;var&lt;/code&gt; keyword).

Personally, I do not like the syntax with which extension methods are called (and I have been very open with MS about this as well).  I believed that at the call site, there should be a different way of calling it, something like &lt;code&gt;obj..MagicDoStuff()&lt;/code&gt; or &lt;code&gt;obj-&gt;MagicDoStuff()&lt;/code&gt; (I prefer the latter for what should be obvious reasons to C++ developers).</description>
		<content:encoded><![CDATA[<p>There is nothing wrong per se with the nomenclature that you suggest: <code>public static class MyExtensions extends object {...}</code>.  However, it does introduce some issues.  The first is that you are limiting the class to be nothing but extensions for object.  This might be fine for some people, but too many people would not want that kind of limitation on their classes.</p>
<p>Also, it should be noted that you do not need to have your class be declared as <code>static</code> in order to use extension methods.  The only requirement for extension methods is that the method be static, and that it use the <code>this</code> qualifier before the type declaration in the parameter list.  The <code>static</code> keyword in a class declaration only tells the compiler to make sure that the type has no constructors, and no instance methods.</p>
<p>In the case of placing an extension method on <code>Object</code> in the <code>System</code> namespace, obviously, that&#8217;s can be a huge issue.  However, it only occurs when you reference two assemblies that put the same extension method (meaning name and parameter list) in the same namespace and you use the <code>using</code> declaration in the file.</p>
<p>In the case of a clash (either with an already existing instance method, or another extension method from another namespace), the compilation should fail, citing that the method is ambiguous (although I have to check the spec for this to be sure).</p>
<p>Remember, extension methods are still static methods, so you can still call them in the standard way.  They are really just compiler magic/syntactic sugar which was implemented to help make LINQ possible (querying over objects).  More specifically, the <code>IEnumerable</code> interface is what is targeted in order to help implement this functionality (along with lambda expressions, anonymous types, and type inference, i.e. the <code>var</code> keyword).</p>
<p>Personally, I do not like the syntax with which extension methods are called (and I have been very open with MS about this as well).  I believed that at the call site, there should be a different way of calling it, something like <code>obj..MagicDoStuff()</code> or <code>obj-&gt;MagicDoStuff()</code> (I prefer the latter for what should be obvious reasons to C++ developers).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Tsai - Blog - C# 3.0: Now with Categories!</title>
		<link>http://www.friday.com/bbum/2007/01/31/c-30-now-with-categories/comment-page-1/#comment-65216</link>
		<dc:creator>Michael Tsai - Blog - C# 3.0: Now with Categories!</dc:creator>
		<pubDate>Wed, 31 Jan 2007 21:17:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/2007/01/31/c-30-now-with-categories/#comment-65216</guid>
		<description>[...] Bill Bumgarner: [...]</description>
		<content:encoded><![CDATA[<p>[...] Bill Bumgarner: [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
