<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 Forums - Coffeehouse - C#&#39;s biggest mistake</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Forums/rss"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 Forums - Coffeehouse - C#&#39;s biggest mistake</title>
		<link>http://channel9.msdn.com/Forums</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Forums</link>
	<language>en</language>
	<pubDate>Mon, 20 May 2013 07:26:02 GMT</pubDate>
	<lastBuildDate>Mon, 20 May 2013 07:26:02 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>49</c9:totalResults>
	<c9:pageCount>-49</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>As languages are evolved, it is clear that compromises (and or mistakes) are made along the way. C# now seems a mature language, with a huge set of API's available, and almost a lack of now stuff to be added that revolutionises the language.</p><p>What would you say is the biggest error they made, in either including, implementing or omitting a feature?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/7260768c0b8c4e409c679e8800963eb6#7260768c0b8c4e409c679e8800963eb6</link>
		<pubDate>Sat, 12 Feb 2011 09:07:01 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/7260768c0b8c4e409c679e8800963eb6#7260768c0b8c4e409c679e8800963eb6</guid>
		<dc:creator>Vesuvius</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/vesuvius/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>from Jon Skeet <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' /> </p><p><a href="http://oredev.org/2010/sessions/c-s-greatest-mistakes">http&#58;&#47;&#47;oredev.org&#47;2010&#47;sessions&#47;c-s-greatest-mistakes</a></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/8832e7693a6f4b1f9d719e8800975a24#8832e7693a6f4b1f9d719e8800975a24</link>
		<pubDate>Sat, 12 Feb 2011 09:11:03 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/8832e7693a6f4b1f9d719e8800975a24#8832e7693a6f4b1f9d719e8800975a24</guid>
		<dc:creator>felix9</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/felix9/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>I think the biggest mistake was the initial release of C# without generics. The traces of the old, non-generic, interfaces, delegates, collections etc. are visible to this day in both user written code and the .NET Framework library.</p><p>Of course, this isn't stricly about C# as the runtime itself didn't support generics at that time...</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/446d7a4b7b4942ada7679e8800d8a04b#446d7a4b7b4942ada7679e8800d8a04b</link>
		<pubDate>Sat, 12 Feb 2011 13:08:42 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/446d7a4b7b4942ada7679e8800d8a04b#446d7a4b7b4942ada7679e8800d8a04b</guid>
		<dc:creator>Dexter</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Dexter/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p><blockquote><div class="quoteText"> </p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Cs-biggest-mistake/446d7a4b7b4942ada7679e8800d8a04b">22 minutes&nbsp;ago</a>, <a href="/Niners/Dexter">Dexter</a> wrote</p><p>I think the biggest mistake was the initial release of C# without generics. The traces of the old, non-generic, interfaces, delegates, collections etc. are visible to this day in both user written code and the .NET Framework library.</p><p>Of course, this isn't stricly about C# as the runtime itself didn't support generics at that time...</p></div></blockquote> <p></p><p>I don't know, the non-generic things like ArrayList and non-typed collection interfaces are useful, so the only problem is the inconsistency in naming (e.g. why isn't it ArrayList&lt;T&gt; instead of List&lt;T&gt; ?) and also namespaces (it would be better if the generic collection types were under System.Collections rather than System.Collections.Generics).</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/14110dcee40c4d78858b9e8800df324f#14110dcee40c4d78858b9e8800df324f</link>
		<pubDate>Sat, 12 Feb 2011 13:32:38 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/14110dcee40c4d78858b9e8800df324f#14110dcee40c4d78858b9e8800df324f</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>Yes, the non generic collections can be useful sometimes but in many (all?) cases you can achieve the same results by using a generic collection with an object type argument (List&lt;object&gt;&nbsp; for example).</p><p>Now, the existence of the non generic collections is not a big issue. The problem is with framework APIs that are still using non generic interfaces (see for example the PropertyDescriptorCollection in System.ComponentModel which implements IList &amp; co.)</p><p>PS: AFAIK &quot;Array&quot; was dropped from List&lt;T&gt; because it unnecessarily exposes an implementation detail (a list is implemented by using an array). </p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/2192e70d62ad47a8aa0d9e8800e18e11#2192e70d62ad47a8aa0d9e8800e18e11</link>
		<pubDate>Sat, 12 Feb 2011 13:41:13 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/2192e70d62ad47a8aa0d9e8800e18e11#2192e70d62ad47a8aa0d9e8800e18e11</guid>
		<dc:creator>Dexter</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Dexter/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p><blockquote><div class="quoteText">Yes, the non generic collections can be useful sometimes but in many (all?) cases you can achieve the same results by using a generic collection with an object type argument (List&lt;object&gt;&nbsp; for example).</p><p>Now, the existence of the non generic collections is not a big issue. The problem is with framework APIs that are still using non generic interfaces (see for example the PropertyDescriptorCollection in System.ComponentModel which implements IList &amp; co.)</div></blockquote></p><p>I'd like to see .DataSource properties (typed as Object) replaced with a more stronger-typed alternative. The documentation lists what interfaces are accepted, so why not put that in the code?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/eab88f33522241dbbadb9e8800efc0e7#eab88f33522241dbbadb9e8800efc0e7</link>
		<pubDate>Sat, 12 Feb 2011 14:32:54 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/eab88f33522241dbbadb9e8800efc0e7#eab88f33522241dbbadb9e8800efc0e7</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>They did so in WPF. The ItemsSource property of the ItemsControl is IEnumerable instead of object <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' />.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/0d06edb2ea3e4503b04a9e8800f775bc#0d06edb2ea3e4503b04a9e8800f775bc</link>
		<pubDate>Sat, 12 Feb 2011 15:00:58 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/0d06edb2ea3e4503b04a9e8800f775bc#0d06edb2ea3e4503b04a9e8800f775bc</guid>
		<dc:creator>Dexter</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Dexter/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p><blockquote><div class="quoteText"> </p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Cs-biggest-mistake/2192e70d62ad47a8aa0d9e8800e18e11">2 hours&nbsp;ago</a>, <a href="/Niners/Dexter">Dexter</a> wrote</p><p>Yes, the non generic collections can be useful sometimes but in many (all?) cases you can achieve the same results by using a generic collection with an object type argument (List&lt;object&gt;&nbsp; for example).</p><p>Now, the existence of the non generic collections is not a big issue. The problem is with framework APIs that are still using non generic interfaces (see for example the PropertyDescriptorCollection in System.ComponentModel which implements IList &amp; co.)</p><p>PS: AFAIK &quot;Array&quot; was dropped from List&lt;T&gt; because it unnecessarily exposes an implementation detail (a list is implemented by using an array). </p></div></blockquote> <p></p><p>How would you explain LinkedList&lt;T&gt;?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/2ae67876452b47fb96729e88010bd205#2ae67876452b47fb96729e88010bd205</link>
		<pubDate>Sat, 12 Feb 2011 16:15:06 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/2ae67876452b47fb96729e88010bd205#2ae67876452b47fb96729e88010bd205</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p><blockquote><div class="quoteText"> </p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Cs-biggest-mistake/2ae67876452b47fb96729e88010bd205">22 minutes&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p>*snip* <p>How would you explain LinkedList&lt;T&gt;?</p></div></blockquote> <p></p><p>I believe that class/struct names should reflect their implementation concept/theory, but that interface types shouldn't. That isn't the same thing as &quot;exposing implementation details&quot; like fields.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/52fd570f53524b3087fb9e8801126b0d#52fd570f53524b3087fb9e8801126b0d</link>
		<pubDate>Sat, 12 Feb 2011 16:39:07 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/52fd570f53524b3087fb9e8801126b0d#52fd570f53524b3087fb9e8801126b0d</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>Well, you cannot have 2 List&lt;T&gt;s, right? Anyway, that's what I read once one some blog, a long time ago.</p><p>If you ask me, this &quot;exposes implementation detail&quot; is a bit pompous. They also changed Hashtable to Dictionary but it's not like you can hide the fact that the Dictionary uses a hashtable internally. You have to document the fact that it requires GetHashCode to work&nbsp;properly, so much for hiding implementation details...</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/bb3f4b96434e4cc586189e88011541b6#bb3f4b96434e4cc586189e88011541b6</link>
		<pubDate>Sat, 12 Feb 2011 16:49:27 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/bb3f4b96434e4cc586189e88011541b6#bb3f4b96434e4cc586189e88011541b6</guid>
		<dc:creator>Dexter</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Dexter/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p><blockquote><div class="quoteText"> </p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Cs-biggest-mistake/52fd570f53524b3087fb9e8801126b0d">29 minutes&nbsp;ago</a>, <a href="/Niners/W3bbo">W3bbo</a> wrote</p>*snip* <p>I believe that class/struct names should reflect their implementation concept/theory, but that interface types shouldn't. That isn't the same thing as &quot;exposing implementation details&quot; like fields.</p></div></blockquote> <p></p><p>I don't really agree with hiding implementation details for collections either. It's very important for the consumer of the collection to know if a list uses a linked list or array, because the difference in algorithmic complexity between the data structure operations could mean order of magnitude(s) worse performance depending on how they are used.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/da0ddf8091d94804ad039e88011cbc38#da0ddf8091d94804ad039e88011cbc38</link>
		<pubDate>Sat, 12 Feb 2011 17:16:41 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/da0ddf8091d94804ad039e88011cbc38#da0ddf8091d94804ad039e88011cbc38</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>Generally speaking C# is a good language. I don't know what would be the worst things, but this is what I don't like.</p><ul><li>More of the .NET thing, but the prefixing of the interfaces with &quot;I&quot;. Just looks ugly to me, and I think it discourges use of interfaces when they really should be used (I don't see IList used so often, even though &quot;List&quot; is an implementation I've seen methods that only accept it). </li><li>As we were talking above, I think the collections in .NET are generally poorly designed. </li><li>The C&#43;&#43; syntax for class inhertence. It makes sense in C&#43;&#43; because there is no language distinction between interface and class. They should have taken Java's syntax for this. </li><li>Multiple language features that do similar (or even the same thing). One example: lambda vs anon functions. </li><li>LINQ-to-Objects. Some people seem to thing it looks fancy in code (I guess?), but I don't think it makes the code any clearer then a simple foreach loop (which tends to be faster anyway). See above also. </li></ul>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/cee733e8b9db4d39bf939e88012033a1#cee733e8b9db4d39bf939e88012033a1</link>
		<pubDate>Sat, 12 Feb 2011 17:29:18 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/cee733e8b9db4d39bf939e88012033a1#cee733e8b9db4d39bf939e88012033a1</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>personally I want:</p><p>array on stack and array embedded/inlined in struct<br>indexed property<br>event assigning in the object initializer block<br>more flexible and powerful generics type parameter constraints, like valuetypes and math operators</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/6df7b44b0d764f47a0c49e8801272dd6#6df7b44b0d764f47a0c49e8801272dd6</link>
		<pubDate>Sat, 12 Feb 2011 17:54:42 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/6df7b44b0d764f47a0c49e8801272dd6#6df7b44b0d764f47a0c49e8801272dd6</guid>
		<dc:creator>felix9</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/felix9/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>I think the way they implemented extension methods is too limited, convoluted&nbsp;and broken. There is a much cleaner and easier way.&nbsp;They should have used the same concept&nbsp;as a&nbsp;&quot;partial&quot; class, and implemented extension methods like this:</p><p><pre class="brush: csharp">public extension class SomeExistingClass
{
    // Add whatever instance or static methods you want
    // Add any properties you want
    // You can't add any new fields though...results in compiler error
}</pre></p><p>The compiler should then impose extension-specific limitations, like the fact that you can't add new fields, but you are now free to add new methods and properties using the exact same syntax that we are already familiar with.</p><p>The advantage here is that there is nothing new that the developer needs to learn other than how to spell &quot;extension&quot;. No more weird static methods with the first &quot;this&quot; parameter, full support for properties and static methods, etc.</p><p>EDIT: Oh, and for value types, the &quot;this&quot; parameter&nbsp;should be a ref to the original struct, not a copy of it. Yes, there really are&nbsp;cases where you want to change just one or two values in a struct for performance reasons (see the XNA Matrix class, which&nbsp;consists of&nbsp;64 bytes and is used in tight loops in 3D games. The existing extension mechanism forces two full copies of a value type if you need to return a modified version of it).</p><p>CLARIFICATION: It seems some people think I'm implying that the class you are extending has to be within the same namespace as the original class. This is not true and this is never what I proposed. The class can be in any other namespace, just like extension methods right now&nbsp;can be in any other namespace. If there&nbsp;are name collisions, you would need to qualify the class you are extending exactly like you would need to qualify it right now with the existing extension mechanism.</p><p>Also, I'm not proposing that the compiler use the exact same restrictions as that of a &quot;partial&quot; class. It is merely a way to demonstrate that there is precedent for <em>similar</em> syntax elsewhere. An extension class will come with its own set of restrictions, and the compiler will enforce those&nbsp; restrictions. For instance, you would not be able to add new fields etc.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/dfea423a77db4f2889399e88012ad8a4#dfea423a77db4f2889399e88012ad8a4</link>
		<pubDate>Sat, 12 Feb 2011 18:08:03 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/dfea423a77db4f2889399e88012ad8a4#dfea423a77db4f2889399e88012ad8a4</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>I personally don't like how nullable structs are exposed through the language. I always got the feeling as if the feature is only half-done <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' /></p><p>But other than that C# is one of my favorite languages!</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/12775098c6c64517ad419e88016564ad#12775098c6c64517ad419e88016564ad</link>
		<pubDate>Sat, 12 Feb 2011 21:41:13 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/12775098c6c64517ad419e88016564ad#12775098c6c64517ad419e88016564ad</guid>
		<dc:creator>Christian Liensberger</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/littleguru/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p><blockquote><div class="quoteText"></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Cs-biggest-mistake/cee733e8b9db4d39bf939e88012033a1">5 hours&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>Generally speaking C# is a good language. I don't know what would be the worst things, but this is what I don't like.</p><ul><li>More of the .NET thing, but the prefixing of the interfaces with &quot;I&quot;. Just looks ugly to me, and I think it discourges use of interfaces when they really should be used (I don't see IList used so often, even though &quot;List&quot; is an implementation I've seen methods that only accept it). </li><li>As we were talking above, I think the collections in .NET are generally poorly designed. </li><li>The C&#43;&#43; syntax for class inhertence. It makes sense in C&#43;&#43; because there is no language distinction between interface and class. They should have taken Java's syntax for this. </li><li>Multiple language features that do similar (or even the same thing). One example: lambda vs anon functions. </li><li>LINQ-to-Objects. Some people seem to thing it looks fancy in code (I guess?), but I don't think it makes the code any clearer then a simple foreach loop (which tends to be faster anyway). See above also. </li></ul><p></div></blockquote></p><p>The IInterface thing is from COM, but I prefer it because often you have types and related interfaces that should have the same name, but without the I prefix you'd get a collision. It is interesting how it's the single exception from the &quot;strictly no hungarian&quot; rule in .NET.</p><p>It also makes it possible to glance at a type definition and see what types it extends vs what interfaces it implements.</p><p>I wouldn't say they do the same thing: Lamba functions are an application of anonymous methods (and as far as CIL is concerned, they're the same thing). It's like saying we shouldn't have verbatim &quot;@&quot; strings because you can express their contents as regular strings.</p><p>Linq-to-Objects is meant for complicated in-memory object graphs. Outside of data access (which we've got Linq-to-Sql for anyway) I can't see many applications. <em>Maybe</em> in massive data visualisation, but I've seen more people abuse it or make something overly complicated.</p><p><blockquote><div class="quoteText"></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Cs-biggest-mistake/6df7b44b0d764f47a0c49e8801272dd6">5 hours&nbsp;ago</a>, <a href="/Niners/felix9">felix9</a> wrote</p><p>personally I want:</p><p>array on stack and array embedded/inlined in struct<br>indexed property<br>event assigning in the object initializer block<br>more flexible and powerful generics type parameter constraints, like valuetypes and math operators</p><p></div></blockquote></p><p>You can already do array-on-stack using the stackalloc keyword and struct arrays with the fixed keyword. The only catch is it's got to be within an unsafe context. For example:</p><p>unsafe struct Foo {<br>&nbsp;&nbsp;&nbsp; public fixed char[128];<br>&nbsp;&nbsp;&nbsp; public static Bar() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int* baz = stackalloc int[ 512 ]; // create a 512-element sized array on the stack, it does not need to be freed<br>&nbsp;&nbsp;&nbsp; }<br>}</p><p>indexed properties... they already exist with the 'this' property, so what you're actually after is <em>named indexed properties</em>. The thing is that such a system would conflict with the current 'this' property (e.g. what happens if a named-indexed-property returns an object with a 'this' property?).</p><p><blockquote><div class="quoteText"></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Cs-biggest-mistake/dfea423a77db4f2889399e88012ad8a4">5 hours&nbsp;ago</a>, <a href="/Niners/BitFlipper">BitFlipper</a> wrote</p><p>I think the way they implemented extension methods is too limited, convoluted&nbsp;and broken. There is a much cleaner and easier way.&nbsp;They should have used the same concept&nbsp;as a&nbsp;&quot;partial&quot; class, and implemented extension methods like this</div></blockquote></p><p>I agree, but that approach doesn't lend itself to making lots of extensions for a large number of types, as you have to create a new type for each of them (even if you're only adding a single new member).</p><p>An advantage of the 'extension class' approach is you can now have extension properties (without any weird convulted syntax).</p><p>The language designers <em>could</em> add both approaches, but then they'd get shot down for language bloat. I guess we're stuck.</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/bf6b6dd9f4594c6d8e0a9e8900018a06#bf6b6dd9f4594c6d8e0a9e8900018a06</link>
		<pubDate>Sun, 13 Feb 2011 00:05:36 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/bf6b6dd9f4594c6d8e0a9e8900018a06#bf6b6dd9f4594c6d8e0a9e8900018a06</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>No's:</p><p>No opt-in policy for nullness (Maybe&lt;T&gt;), except for structs via Nullable&lt;T&gt;<br>No opt-in policy for mutability (classes, structs)<br>No recursive enumerations (datatype constructors) or pattern-matching<br>No generic numerics<br>No kind-system</p><p>Hmm's:</p><p>Slow linq to objects, unsuitable for fundamentalists (iterators don't mesh well with recursive use/structures.)<br>Partial classes and extension methods - not as holistically designed as one might wish<br><br>Symptoms of a 10 year old language and runtime.<br><br>Dispite all this it's still a great language.</p><p>PS - language doesn't need runtime just to support generics - look at Java. Bracha et al made generics via type-erasure (don't like it due to performance, but it shows its possible.)</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/4a7d6ae1513f409582ba9e8900092ec0#4a7d6ae1513f409582ba9e8900092ec0</link>
		<pubDate>Sun, 13 Feb 2011 00:33:25 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/4a7d6ae1513f409582ba9e8900092ec0#4a7d6ae1513f409582ba9e8900092ec0</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>Well I wonder how feasible it would be deprecate some of the older features? And when I say &quot;deprecate&quot;, I mean not just a warning, but completely removing it from the language. </p><p>I mean, it isn't as if your current projects automatically starts using the latest .Net version without your control. You usually have to tweak a project anyway when you switch .Net versions, so I don't think it is such a bad thing.</p><p>This will ensure that the language doesn't get too bloated just for the sake of backwards compatibility when there are new/better ways to do the same thing.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/381ca5f2350e4a99bd649e890022f010#381ca5f2350e4a99bd649e890022f010</link>
		<pubDate>Sun, 13 Feb 2011 02:07:12 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/381ca5f2350e4a99bd649e890022f010#381ca5f2350e4a99bd649e890022f010</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>When C# was a teenager it was into drugs, and although it went to rehab, this set back its college education for 10 years. By that time, it was harder to get a job, because all of the tech companies were looking for younger people.</p><p>That was C#'s greatest mistake.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/00166b67dc4f46748ac79e89003cecb6#00166b67dc4f46748ac79e89003cecb6</link>
		<pubDate>Sun, 13 Feb 2011 03:41:49 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/00166b67dc4f46748ac79e89003cecb6#00166b67dc4f46748ac79e89003cecb6</guid>
		<dc:creator>brian.shapiro</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/brian.shapiro/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Cs-biggest-mistake#ccee733e8b9db4d39bf939e88012033a1">Bass</a>:<em>LINQ-to-Objects. Some people seem to thing it looks fancy in code (I guess?), but I don't think it makes the code any clearer then a simple foreach loop (which tends to be faster anyway). See above also.</em></p><p>I have to say I think code is eminently more readable when you have a .Any(a=&gt;) or .All(a=&gt;) or .Skip(a=&gt;). IF you work with low level image or video processing, you typically end up with several nested&nbsp;for loops and a state machine&nbsp;(it is <strong>never </strong>a simple for loop) just to express the standard sequence operators. When you add this code plus the complex maths and protocols in the code anyway, anything that increases readability is a Godsend.</p><p>That is singularly the greatest addition to C# in my opinion. If people have issues with performance then use C&#43;&#43; but I use them in pretty hardcode situations, where the customer complains abaout any slowness,&nbsp;and they are still quick</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/a44d253ec9244211a68b9e89009705b4#a44d253ec9244211a68b9e89009705b4</link>
		<pubDate>Sun, 13 Feb 2011 09:09:51 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/a44d253ec9244211a68b9e89009705b4#a44d253ec9244211a68b9e89009705b4</guid>
		<dc:creator>Vesuvius</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/vesuvius/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p><blockquote><div class="quoteText"></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Cs-biggest-mistake/bf6b6dd9f4594c6d8e0a9e8900018a06">18 hours&nbsp;ago</a>, <a href="/Niners/W3bbo">W3bbo</a> wrote</p><p>I agree, but that approach doesn't lend itself to making lots of extensions for a large number of types, as you have to create a new type for each of them (even if you're only adding a single new member).</p><p>An advantage of the 'extension class' approach is you can now have extension properties (without any weird convulted syntax).</p><p>The language designers <em>could</em> add both approaches, but then they'd get shot down for language bloat. I guess we're stuck.</p><p></div></blockquote></p><p>Do you really think the following is too verbose? It looks pretty clear and concise to me. It only adds three total extra lines for each type you want to extend.</p><p><pre class="brush: csharp">public extension class SomeExistingClass
{
    public string DoSomethingNew()
    {
        //...
        return result;
    }
}</pre></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/5c931cdefe154f40993c9e89012cc8e5#5c931cdefe154f40993c9e89012cc8e5</link>
		<pubDate>Sun, 13 Feb 2011 18:15:07 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/5c931cdefe154f40993c9e89012cc8e5#5c931cdefe154f40993c9e89012cc8e5</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Cs-biggest-mistake#c5c931cdefe154f40993c9e89012cc8e5">BitFlipper</a>:Thing is, I'm not so&nbsp;sure extension methods would have been added without Linq, though most people complain that they want to extend types and so on, otherwise we would have heard extensions methods&nbsp;pre-Linq. They were an enabler of the technology, rather than a language feature like generics</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/a9fc9af284dc4d5f8b789e890141aa3f#a9fc9af284dc4d5f8b789e890141aa3f</link>
		<pubDate>Sun, 13 Feb 2011 19:31:08 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/a9fc9af284dc4d5f8b789e890141aa3f#a9fc9af284dc4d5f8b789e890141aa3f</guid>
		<dc:creator>Vesuvius</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/vesuvius/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Cs-biggest-mistake#ca9fc9af284dc4d5f8b789e890141aa3f">vesuvius</a>:</p><p>Yes true, but you have to agree that the way extension methods have since been used and abused in cases that have nothing to do with LINQ just shows that it is something that a lot of people want to use, and obviously find that it is useful to them.</p><p>I'm just suggesting a way to clean it up and make it more consistent with the rest of the language (we all know how partial classes work). The current extension syntax is convoluted and limiting and doesn't seem to fit in with the rest of the language (it seems contrived to me).</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/f49a7c3b05104329b74f9e89014d1aff#f49a7c3b05104329b74f9e89014d1aff</link>
		<pubDate>Sun, 13 Feb 2011 20:12:47 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/f49a7c3b05104329b74f9e89014d1aff#f49a7c3b05104329b74f9e89014d1aff</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Cs-biggest-mistake#c5c931cdefe154f40993c9e89012cc8e5">BitFlipper</a>: The problem with your syntax is that the extension class would have to be in the same namespace as the original, which means it'll typically be in a completely different namespace than anything else in your assembly. And if you stick with the current way of importing extension methods, there'd be no way to import the original type without the extension methods if they're referencing your assembly.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/d6b2bb7d8c684575baec9e8a001f1110#d6b2bb7d8c684575baec9e8a001f1110</link>
		<pubDate>Mon, 14 Feb 2011 01:53:06 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/d6b2bb7d8c684575baec9e8a001f1110#d6b2bb7d8c684575baec9e8a001f1110</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>That syntax is very similar to how Ruby handles extending classes. </p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/d81f8eb0c37e483a90009e8a002c6fd7#d81f8eb0c37e483a90009e8a002c6fd7</link>
		<pubDate>Mon, 14 Feb 2011 02:41:47 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/d81f8eb0c37e483a90009e8a002c6fd7#d81f8eb0c37e483a90009e8a002c6fd7</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p><blockquote><div class="quoteText"> </p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Cs-biggest-mistake/a44d253ec9244211a68b9e89009705b4">17 hours&nbsp;ago</a>, <a href="/Niners/vesuvius">vesuvius</a> wrote</p><p>@<a href="/Forums/Coffeehouse/Cs-biggest-mistake#ccee733e8b9db4d39bf939e88012033a1">Bass</a>:<em>LINQ-to-Objects. Some people seem to thing it looks fancy in code (I guess?), but I don't think it makes the code any clearer then a simple foreach loop (which tends to be faster anyway). See above also.</em></p><p>I have to say I think code is eminently more readable when you have a .Any(a=&gt;) or .All(a=&gt;) or .Skip(a=&gt;). IF you work with low level image or video processing, you typically end up with several nested&nbsp;for loops and a state machine&nbsp;(it is <strong>never </strong>a simple for loop) just to express the standard sequence operators. When you add this code plus the complex maths and protocols in the code anyway, anything that increases readability is a Godsend.</p><p>That is singularly the greatest addition to C# in my opinion. If people have issues with performance then use C&#43;&#43; but I use them in pretty hardcode situations, where the customer complains abaout any slowness,&nbsp;and they are still quick</p></div></blockquote> <p></p><p>I think normal code tends to be far more readable then complex LINQ or SQL statements.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/07d10af7199a438bbd9b9e8a002d2c7a#07d10af7199a438bbd9b9e8a002d2c7a</link>
		<pubDate>Mon, 14 Feb 2011 02:44:28 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/07d10af7199a438bbd9b9e8a002d2c7a#07d10af7199a438bbd9b9e8a002d2c7a</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Cs-biggest-mistake#cd6b2bb7d8c684575baec9e8a001f1110">Sven Groot</a>:</p><p>Sorry I don't understand why there would be any such a limitation. Why can the compiler create extension methods right now without the code being in the same namespace, but won't be able to do essentially the exact same thing but with only syntactic differences from the current implementation? What technical reason do you foresee that would require the extension class to be in the same namespace as the original?</p><p>EDIT: I suspect you are thinking too much about how partial classes work. It doesn't mean the same restrictions need to apply to extension classes as those that do to partial classes. They would be different concepts, each with their different set of restrictions. The namespace restriction doesn't need to apply at all to extension classes, just like they don't apply to extension methods right now.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/48da326af986442dbe119e8a00369a0a#48da326af986442dbe119e8a00369a0a</link>
		<pubDate>Mon, 14 Feb 2011 03:18:47 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/48da326af986442dbe119e8a00369a0a#48da326af986442dbe119e8a00369a0a</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>Okay, so let's say I have this:</p><p><pre class="brush: csharp">namespace Foo
{
  public extension class String
  {
  }
}</pre></p><p>How would the compiler know that the extensions are for System.String and not for Other.Namespace.String?</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/b1d47686bd7b464db2149e8a0058e05d#b1d47686bd7b464db2149e8a0058e05d</link>
		<pubDate>Mon, 14 Feb 2011 05:23:35 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/b1d47686bd7b464db2149e8a0058e05d#b1d47686bd7b464db2149e8a0058e05d</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>Obvious?</p><p><pre class="brush: csharp">public extension class System.String</pre></p><p>Evil&nbsp;variant for those who can stand the syntactic similarity but different interpretation to an unspecified foreign language entity</p><p><pre class="brush: csharp">public class String extends System.String</pre></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/9b0d0c70330a4cb08bbb9e8a005e64b0#9b0d0c70330a4cb08bbb9e8a005e64b0</link>
		<pubDate>Mon, 14 Feb 2011 05:43:40 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/9b0d0c70330a4cb08bbb9e8a005e64b0#9b0d0c70330a4cb08bbb9e8a005e64b0</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Cs-biggest-mistake#c07d10af7199a438bbd9b9e8a002d2c7a">Bass</a>:Are you implying&nbsp;statements are more normal than expressions? <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-5.gif?v=c9' alt='Wink' /></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/4d711a66eaf446d8ae5c9e8a0060be12#4d711a66eaf446d8ae5c9e8a0060be12</link>
		<pubDate>Mon, 14 Feb 2011 05:52:13 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/4d711a66eaf446d8ae5c9e8a0060be12#4d711a66eaf446d8ae5c9e8a0060be12</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Cs-biggest-mistake#cb1d47686bd7b464db2149e8a0058e05d">Sven Groot</a>:</p><p>How does the compiler know which class to extend with the current extension syntax?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/9a4c83935827493abfb39e8a0085b0cf#9a4c83935827493abfb39e8a0085b0cf</link>
		<pubDate>Mon, 14 Feb 2011 08:06:45 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/9a4c83935827493abfb39e8a0085b0cf#9a4c83935827493abfb39e8a0085b0cf</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p><blockquote><div class="quoteText"> </p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Cs-biggest-mistake/9a4c83935827493abfb39e8a0085b0cf">2 hours&nbsp;ago</a>, <a href="/Niners/BitFlipper">BitFlipper</a> wrote</p><p>@<a href="/Forums/Coffeehouse/Cs-biggest-mistake#cb1d47686bd7b464db2149e8a0058e05d">Sven Groot</a>:</p><p>How does the compiler know which class to extend with the current extension syntax?</p><p></p><p></div></blockquote></p><p>The class' type is specified as a parameter to the method, so the type name just needs to be qualified as such:</p><p>using MyNamespace1;</p><p>namespace MyNameSpace2 {</p><p>public static class Extensions {</p><p>public static void MyExtensionMethod(this MyClassInNamespace1 item) {</p><p>}</p><p>}</p><p>}</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/f7e771fb28fe4e1bbee29e8a00b1a4ac#f7e771fb28fe4e1bbee29e8a00b1a4ac</link>
		<pubDate>Mon, 14 Feb 2011 10:46:46 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/f7e771fb28fe4e1bbee29e8a00b1a4ac#f7e771fb28fe4e1bbee29e8a00b1a4ac</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Cs-biggest-mistake#cf7e771fb28fe4e1bbee29e8a00b1a4ac">W3bbo</a>:</p><p>Correct, I'm just trying to understand the problem that Sven identified.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/f254bbf4da3c4299a4a89e8a015bf429#f254bbf4da3c4299a4a89e8a015bf429</link>
		<pubDate>Mon, 14 Feb 2011 21:06:51 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/f254bbf4da3c4299a4a89e8a015bf429#f254bbf4da3c4299a4a89e8a015bf429</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>So far I have no complains. Doing some C&#43;&#43; project right now, and I so hope I can use C#. It is not just GC thing, but, so many simple things like Random/Collection (rand, vector)&nbsp;etc is much harder to use compare C# classes. And the naming on C# is much human readible instead of some whacky short names. And I hate header, eekk.</p><p>I am sure C# is some short coming, but, I cannot remember what they are, which is a good thing. Meaning it is not pissing me off enough for me to remember.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/87d8dfca117d48f291f19e8b00380d6b#87d8dfca117d48f291f19e8b00380d6b</link>
		<pubDate>Tue, 15 Feb 2011 03:24:04 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/87d8dfca117d48f291f19e8b00380d6b#87d8dfca117d48f291f19e8b00380d6b</guid>
		<dc:creator>magicalclick</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/magicalclick/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>There's a second Jon Skeet presentation about C# weirdness/abuse. There's a pretty interesting gotcha about enumerators in there:</p><p><a href="http://oredev.org/2010/sessions/abusing-c-">Abusing C#</a></p><p>I know I'm going to be rewriting some experimental code based on this at least.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/0fad95bd252e410bbbe09e8b016cebb8#0fad95bd252e410bbbe09e8b016cebb8</link>
		<pubDate>Tue, 15 Feb 2011 22:08:38 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/0fad95bd252e410bbbe09e8b016cebb8#0fad95bd252e410bbbe09e8b016cebb8</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>It's not a mistake per se, but C# and the .NET Framework need some notion of higher kinds to take things to the next level, I think.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/d970f84ff8bc4ff689e49e8c005f1c89#d970f84ff8bc4ff689e49e8c005f1c89</link>
		<pubDate>Wed, 16 Feb 2011 05:46:17 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/d970f84ff8bc4ff689e49e8c005f1c89#d970f84ff8bc4ff689e49e8c005f1c89</guid>
		<dc:creator>Richard Anthony Hein</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Richard.Hein/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p><blockquote><div class="quoteText"></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Cs-biggest-mistake/f254bbf4da3c4299a4a89e8a015bf429">1 day&nbsp;ago</a>, <a href="/Niners/BitFlipper">BitFlipper</a> wrote</p><p>@<a href="/Forums/Coffeehouse/Cs-biggest-mistake#cf7e771fb28fe4e1bbee29e8a00b1a4ac">W3bbo</a>:</p><p>Correct, I'm just trying to understand the problem that Sven identified.</p><p></div></blockquote></p><p>The 'partial' type syntax doesn't give you any way to say I want to extend a class from namespace A and I want the extension to be in namespace B. Which is basically an essential feature if you don't want to risk name collisions.</p><p>It also creates a possibly awkward problem that you'd need to support properties extensions, operator extensions, event extensions and pretty much anything else you can think of that could be defined in a class extensions, or else the syntax will seem jarring (why does turning this into an extension suddenly break X, Y and Z)</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/3b68b906d32f44aca4879e8c00df9436#3b68b906d32f44aca4879e8c00df9436</link>
		<pubDate>Wed, 16 Feb 2011 13:34:01 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/3b68b906d32f44aca4879e8c00df9436#3b68b906d32f44aca4879e8c00df9436</guid>
		<dc:creator>AndyC</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/AndyC/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p><blockquote><div class="quoteText"> </p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Cs-biggest-mistake/3b68b906d32f44aca4879e8c00df9436">5 hours&nbsp;ago</a>, <a href="/Niners/AndyC">AndyC</a> wrote</p><p></p><p>The 'partial' type syntax doesn't give you any way to say I want to extend a class from namespace A and I want the extension to be in namespace B. Which is basically an essential feature if you don't want to risk name collisions.</div></blockquote></p><p>But it does. In the example I posted the extension exists in MyNamespace1, but the class to be extended exists in MyNamespace2.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/040d6e89ca174e2da6a59e8c0136e784#040d6e89ca174e2da6a59e8c0136e784</link>
		<pubDate>Wed, 16 Feb 2011 18:51:58 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/040d6e89ca174e2da6a59e8c0136e784#040d6e89ca174e2da6a59e8c0136e784</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p><blockquote><div class="quoteText"></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Cs-biggest-mistake/040d6e89ca174e2da6a59e8c0136e784">2 hours&nbsp;ago</a>, <a href="/Niners/W3bbo">W3bbo</a> wrote</p><p>*snip*</p><p>But it does. In the example I posted the extension exists in MyNamespace1, but the class to be extended exists in MyNamespace2.</p><p></div></blockquote></p><p>Yes, but your example is how the real thing works and not the way BitFlipper was proposing it should have been done.</p><p>Bass' suggestion is probably closer to what you'd have to do, but it looks wrong and too easily confused with inheritance.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/dc20f31527e94e8b8cb59e8c01612e5c#dc20f31527e94e8b8cb59e8c01612e5c</link>
		<pubDate>Wed, 16 Feb 2011 21:25:53 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/dc20f31527e94e8b8cb59e8c01612e5c#dc20f31527e94e8b8cb59e8c01612e5c</guid>
		<dc:creator>AndyC</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/AndyC/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p><blockquote><div class="quoteText"> </p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Cs-biggest-mistake/3b68b906d32f44aca4879e8c00df9436">9 hours&nbsp;ago</a>, <a href="/Niners/AndyC">AndyC</a> wrote</p>*snip* <p>The 'partial' type syntax doesn't give you any way to say I want to extend a class from namespace A and I want the extension to be in namespace B. Which is basically an essential feature if you don't want to risk name collisions.</p><p></div></blockquote></p><p>I just left out the namspace because I thought&nbsp;it&nbsp;was kind of obvious that you can resolve name collisions in exactly the same way you do right now with the current extension mechanism (or anywhere else in .Net for that matter). If the compiler complains about a name collision, simply add the namespace in front of the class you are extending. Why is this suddenly such a big problem?</p><p><blockquote><div class="quoteText"></p><p>It also creates a possibly awkward problem that you'd need to support properties extensions, operator extensions, event extensions and pretty much anything else you can think of that could be defined in a class extensions, or else the syntax will seem jarring (why does turning this into an extension suddenly break X, Y and Z)</p></div></blockquote> <p></p><p>The compiler will prevent you from doing things that don't make sense&nbsp;within the context of the extension class, like trying to add new fields, etc. How would this be any more &quot;jarring&quot; than what we have right now? Even if it only allows new methods and properties, it would already be an improvement over what we have now, and the syntax would be much less jarring than the current extension syntax.</p><p>If you look at the &quot;partial class&quot; documentation, it lists a set of restrictions, and the compiler will let you know&nbsp;when you don't follow those restrictions. Why&nbsp;can a different set of restrictions not be applied in the case of an&nbsp;extension class? We aren't talking about just allowing you to add &quot;extension&quot; before a class, instead this is about adding new functionality to the compiler so that it is fully aware of such a new extension mechanism and its restrictions.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/db996259080e4f95bcbe9e8c01852579#db996259080e4f95bcbe9e8c01852579</link>
		<pubDate>Wed, 16 Feb 2011 23:36:50 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/db996259080e4f95bcbe9e8c01852579#db996259080e4f95bcbe9e8c01852579</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>But this is not orthogonal and goes against the principle of least surprise. When&nbsp;I am creating what appears to be a new class definition, using your&nbsp;&quot;extension class Foo&quot; syntax, I would not expect the identifier to be resolved according to the using statements nor would I expect to be able to fully quality it. That is not the way things work for any other context in which you are defining a new type, so it would be jarring to have them work this way here.</p><p>There is also the question of what the extension class would then actually be called (so that languages that don't support extension methods can access them as regular static methods), and how to deal with the possibility of the this parameter being null. For the latter, it seems it would be easy to say that you can just have the compiler insert a null check before calling the extension method, just like the JIT does for regular methods. But, again we must remember that extension methods are actually static methods and can be called as such, and in that case there's nothing stopping you from passing null, which the method would then not be prepared to handle. You can get around that by making extension methods a CLR feature, but then .Net 3.5 would not have been able to run on the 2.0 CLR.</p><p>The null issue can be gotten around I guess by simply saying that in extension methods, this can be null, but it does feel a bit weird.</p><p>How about this alternative:</p><p><pre class="brush: csharp">static class Extensions
{
  public static void System.String.DoSomething(int x) { }
}</pre></p><p>It's similar to the syntax used for explicit interface implementations, so it has precedent. Though admittedly it does also suffer from the &quot;this can be null&quot; issue.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/03d5c860a5c24df4b1c89e8d0024109c#03d5c860a5c24df4b1c89e8d0024109c</link>
		<pubDate>Thu, 17 Feb 2011 02:11:18 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/03d5c860a5c24df4b1c89e8d0024109c#03d5c860a5c24df4b1c89e8d0024109c</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Cs-biggest-mistake#c03d5c860a5c24df4b1c89e8d0024109c">Sven Groot</a>:</p><p>&nbsp;</p><p>I'm a little bit unsure as to why you are trying to overcomplicate things. What I am proposing is changing...</p><p>&nbsp;</p><p><pre class="brush: csharp">public static class MyExtensions
{
    public static int WordCount(this System.String str)
    {
        // ...
        return wordCount;
    }
}</pre></p><p>&nbsp;</p><p>... to ...</p><p>&nbsp;</p><p><pre class="brush: csharp">public extension class System.String
{
    public int WordCount()
    {
        // ...
        return wordCount;
    }
}
</pre></p><p>&nbsp;</p><p>It is merely a syntax change in how you write extensions to classes. Internally the compiler treats it <strong>exactly</strong> the same as it does right now, and emits exactly the same MSIL. Why would there suddenly be this&nbsp;list of new technical hurdles that do not&nbsp;exist in the current implementation?</p><p>&nbsp;</p><p>How does the current implementation deal with the &quot;using&quot; statement? How does the current implementation deal with a null this parameter? There are&nbsp;you answers.</p><p>&nbsp;</p><p>A long time ago there was a thread on C9&nbsp;about missing extension properties, and IIRC, the reason given that there aren't any extension properties was that they could not come up with a satisfactory syntax for it. With&nbsp;the proposed syntax, it would be&nbsp;possible to add extension properties (and any other class features that make sense in the context of an extension class)&nbsp;in a&nbsp;known and familiar&nbsp;way that doesn't feel as contrived as what it apparently needs to be if it had to be added to the existing extension mechanism.</p><p>&nbsp;</p><p>In addition, the properties will just be compiled to the get_ and set_ methods anyway, so there should not be any problem with properties in this case either since the syntax issue with the current mechanism would be resolved.</p><p>&nbsp;</p><p>Can you clarify what the big problem is in this case?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/52ce3edd13a04aeeb4a69e8e0106e114#52ce3edd13a04aeeb4a69e8e0106e114</link>
		<pubDate>Fri, 18 Feb 2011 15:57:06 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/52ce3edd13a04aeeb4a69e8e0106e114#52ce3edd13a04aeeb4a69e8e0106e114</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Cs-biggest-mistake#c52ce3edd13a04aeeb4a69e8e0106e114">BitFlipper</a>: You make a compelling case.</p><p>Also note that extension methods can safely deal with nullness, which can be an asset, not a problem: consider this:&nbsp;string.IsNullOrWhitespace(myStr) vs myStr.IsNullOrWhitespace().</p><p>The instance method cannot check for the presence of this-nullness (although that could be a neat feature to contemplate) but if IsNullOrWhitespace is an extension method it is entirely safe and in this case part of the job of the method to check for nullness.</p><p>The general problem of nullness is not solved with extension methods but since all extension methods must deal with it anyway, in one way or another, it doesn't get worse either.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/475ff8216455427e92ab9e8e01268cd5#475ff8216455427e92ab9e8e01268cd5</link>
		<pubDate>Fri, 18 Feb 2011 17:52:25 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/475ff8216455427e92ab9e8e01268cd5#475ff8216455427e92ab9e8e01268cd5</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Cs-biggest-mistake#c52ce3edd13a04aeeb4a69e8e0106e114">BitFlipper</a>: The problem is one of expectation. Consider a regular class:</p><p>&nbsp;</p><p><pre class="brush: csharp">class Foo // this is the name of the class; it is scoped strictly
          // to the current namespace and cannot be fully qualified
{
  public static int SomeMethod()
  {
    return this.Something; // this is guaranteed not to be null
  }
}</pre></p><p>&nbsp;</p><p>Now look at your syntax:</p><p><pre class="brush: csharp">extension class Foo // this is the no longer the name of the class (what would be?);
                    // it refers to a class in a different namespace but defines
                    // one in the current namespace and can suddenly be fully
                    // qualified, even though you can not normally do that in this context.
{
  public static int SomeMethod()
  {
    return this.Something; // this can suddenly be null
  }
}</pre></p><p>&nbsp;</p><p>This hypothetical &quot;extension&quot; keyword changes the meaning of the name and the semantics of the method in a way that is inconsistent with how the language works elsewhere.</p><p>&nbsp;</p><p>By comparison, the actual current syntax doesn't change the meaning of a class declaration statement, and it makes it explicit that, regardless of how it may be invoked, the parameter that takes on the role of &quot;this&quot; is still a regular parameter and can therefore be null so you should check that and throw an ArgumentNullException if necessary.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/01e836ed79cc4d959fa69e8f00fac34b#01e836ed79cc4d959fa69e8f00fac34b</link>
		<pubDate>Sat, 19 Feb 2011 15:12:59 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/01e836ed79cc4d959fa69e8f00fac34b#01e836ed79cc4d959fa69e8f00fac34b</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Cs-biggest-mistake#c01e836ed79cc4d959fa69e8f00fac34b">Sven Groot</a>:</p><p>&nbsp;</p><p>Yes I see your point but why can't the compiler insert a null check <em>before</em> you even enter the extension method, just like it happens right now with regular methods? So if I have:</p><p>&nbsp;</p><p><pre class="brush: csharp">string someString = null;
someString.ToLower();    // &lt;- NullReferenceException</pre></p><p>&nbsp;</p><p>So if I do the same for an extension method, I should get:</p><p>&nbsp;</p><p><pre class="brush: csharp">string someString = null;
someString.MyExtensionMethod(); // &lt;- NullReferenceException</pre></p><p>&nbsp;</p><p>The way the current extension methods work is the one that has&nbsp;the problem with expectation. This is actually another opportunity to clean it up and make extension methods more consistent with regular methods&nbsp;and&nbsp;remove the problem with expectation that extension methods created in the first place.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/1e8662e51ee34da4a3839e8f01241ca1#1e8662e51ee34da4a3839e8f01241ca1</link>
		<pubDate>Sat, 19 Feb 2011 17:43:32 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/1e8662e51ee34da4a3839e8f01241ca1#1e8662e51ee34da4a3839e8f01241ca1</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>You are now starting to charge the semantics of extension methods to mean something more than syntax sugar over a static method. Basically, you want C# to support something like (run-time) Mixins.</p><p>&nbsp;</p><p>Here is an example from Ruby:</p><p><a href="http://donttrustthisguy.com/2005/12/31/ruby-extending-classes-and-method-chaining/">http&#58;&#47;&#47;donttrustthisguy.com&#47;2005&#47;12&#47;31&#47;ruby-extending-classes-and-method-chaining&#47;</a></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/6ced197fdc7e4f0bb4e49e8f012ac267#6ced197fdc7e4f0bb4e49e8f012ac267</link>
		<pubDate>Sat, 19 Feb 2011 18:07:44 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/6ced197fdc7e4f0bb4e49e8f012ac267#6ced197fdc7e4f0bb4e49e8f012ac267</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Cs-biggest-mistake#c6ced197fdc7e4f0bb4e49e8f012ac267">Bass</a>:</p><p>&nbsp;</p><p>Right now the compiler/IDE does everything it can&nbsp;to make extension methods appear like regular methods. Why is it doing that? The way it is currently implemented, it can't get there all the way.&nbsp;Why not go all the way and&nbsp;truly make them feel and act like regular methods? Are we so used to the discrepancies and limitations at this point that we should try and maintain the&nbsp;status quo? Or is there a use case where they are required to be&nbsp;as wonky as they are right now?</p><p>&nbsp;</p><p>Also,&nbsp;why does extension methods <em>need</em> to feel and act like static methods at all?&nbsp;Isn't that&nbsp;just a side-effect of how&nbsp;the current implementation works? You can even go so far and say that if you want a static method, you can&nbsp;use the &quot;static&quot; keyword just like you can with a regular method and it will feel and act just like a regular static method.</p><p>&nbsp;</p><p>EDIT: Obviously the compiler is well aware of extension methods as it currently implemented. Before extension methods were added, the same code would have refused to compile (what is this &quot;this&quot; thing before the type in the parameter list?). My point is that the compiler is already involved. I don't think the compiler support to make this suggestion work&nbsp;is necessarily much more complicated, just<em> different</em>. Yes I think there will probably be some&nbsp;more work for the compiler but the benefits of more consistency, familiarity for developers and new opportunities to add features like properties without contrived syntaxes&nbsp;outweigh the added complexity.&nbsp;&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/661e9db2464844f2adf19e8f013ec3df#661e9db2464844f2adf19e8f013ec3df</link>
		<pubDate>Sat, 19 Feb 2011 19:20:35 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/661e9db2464844f2adf19e8f013ec3df#661e9db2464844f2adf19e8f013ec3df</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Cs-biggest-mistake#c661e9db2464844f2adf19e8f013ec3df">BitFlipper</a>: But what about languages that don't directly support extension methods? They can still call them, but just as regular static methods. There would be no null-check inserted by those compilers.</p><p>&nbsp;</p><p>Unless of course you want that check to be added in the extension method itself, which is against going against expectation (slightly) because that's not where you'd expect the NullReferenceException to be thrown.</p><p>&nbsp;</p><p>And then there's languages&nbsp; that don't have any syntax for extension methods (like VB). They can still declare them by decorating a method with the ExtensionAttribute, but of course the compiler won't add any extra stuff in those cases.</p><p>&nbsp;</p><p>Your syntax has merits, but I just feel it introduces too many corner cases and goes against how the language normally works in too many places. The only real way to get around that is to make extension methods a CLR feature rather than purely syntactic sugar.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/cfcb4cca5b114655bec39e9000317d98#cfcb4cca5b114655bec39e9000317d98</link>
		<pubDate>Sun, 20 Feb 2011 03:00:11 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/cfcb4cca5b114655bec39e9000317d98#cfcb4cca5b114655bec39e9000317d98</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C#&#39;s biggest mistake</title>
		<description><![CDATA[<p>I believe the biggest weakness is the type system (a CLR error, not specifically a c# error). A derived type overriding a base type method should be able to weaken preconditions and strengthen postconditions in the overriding method. If we take preconditions and postconditions to include the argment types and return type of the method, an overriding method should be able to substitute base types for the type specified for an argument, and should be able to substitute a derived type for the return type.</p><p>&nbsp;</p><p>This would have solved problems such as the original IClonable interface problem. If I clone a Foo derived from ICloneable, the method Foo.Clone override could return a Foo instead of an Object, without needing to use a generic interface. When working with an instance typed as Foo, you would not need to downcast the returned clone as a Foo.</p><p>&nbsp;</p><p>Because it introduces new problems such how to do overloaded methods, it is a fundamental aspect of a type system that has to be figured out before a language is designed. I think it would have been a better type system, closer to the type hierarchy as described in the original Liskov &quot;Abstraction and Specification in Program Design&quot;.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/bfbdfa09448e4edcaf4b9e9001584bfd#bfbdfa09448e4edcaf4b9e9001584bfd</link>
		<pubDate>Sun, 20 Feb 2011 20:53:32 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Cs-biggest-mistake/bfbdfa09448e4edcaf4b9e9001584bfd#bfbdfa09448e4edcaf4b9e9001584bfd</guid>
		<dc:creator>Frank Hileman</dc:creator>
		<slash:comments>49</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Frank Hileman/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>