<?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++ needs extension methods</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++ needs extension methods</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>Wed, 22 May 2013 07:36:23 GMT</pubDate>
	<lastBuildDate>Wed, 22 May 2013 07:36:23 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>48</c9:totalResults>
	<c9:pageCount>-48</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>doing some C&#43;&#43; work ... c&#43;&#43; would be better with extension methods.</p><p>Working with a C&#43;&#43; class library. One class has a function that returns the position and size of a window.<br>void&nbsp; GetWindowRect(long *XPos, long *YPos, long *Width, long *Height) const;&nbsp;</p><p>But I need the window info as a RECT. In C# that is no problem. Just code an extension method. No can do in C&#43;&#43;.&nbsp; Even the simple process of organizing your code is a bit of a chore in C&#43;&#43; compared to C#.&nbsp; As I code the helper functions which will work like extension methods, where to place the code? I do not think I can add sub folders to a c&#43;&#43; project like I can in C#.</p><p>-Steve</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/7bd7b42469744c719cbca04d01180b9b#7bd7b42469744c719cbca04d01180b9b</link>
		<pubDate>Thu, 10 May 2012 16:59:36 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/7bd7b42469744c719cbca04d01180b9b#7bd7b42469744c719cbca04d01180b9b</guid>
		<dc:creator>Steve Richter</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SteveRichter/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>This sounds like something you should take up with the C&#43;&#43; standards&nbsp;committee. They decide how the&nbsp;language&nbsp;works.</p><p>In the meantime you can just use a static method:</p><p>__inline void GetWindowLongFromObject(__in Object* o, __out RECT* rect)<br>{<br>&nbsp; o-&gt;GetWindowRect(&amp;rect-&gt;x, &amp;rect-&gt;y, &amp;rect-.w, &amp;rect-&gt;h);&nbsp;<br>}&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/ac13e6d9b6bb4750b698a04d011b4acf#ac13e6d9b6bb4750b698a04d011b4acf</link>
		<pubDate>Thu, 10 May 2012 17:11:26 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/ac13e6d9b6bb4750b698a04d011b4acf#ac13e6d9b6bb4750b698a04d011b4acf</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/ac13e6d9b6bb4750b698a04d011b4acf">5 minutes&nbsp;ago</a>, <a href="/Niners/evildictaitor">evildictaitor</a> wrote</p><p>{<br>&nbsp; o-&gt;GetWindowRect(&amp;rect-&gt;x, &amp;rect-&gt;y, &amp;rect-.w, &amp;rect-&gt;h);&nbsp;<br>}&nbsp;</p><p></p></div></blockquote><p></p><p>neat. Drop the values directly into the RECT struct.&nbsp; Only problem is a WIN32 RECT does not contain a height and a width. But I like the idea.</p><p>thanks,</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/4518d06406cb46c897fba04d011ddb30#4518d06406cb46c897fba04d011ddb30</link>
		<pubDate>Thu, 10 May 2012 17:20:46 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/4518d06406cb46c897fba04d011ddb30#4518d06406cb46c897fba04d011ddb30</guid>
		<dc:creator>Steve Richter</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SteveRichter/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/ac13e6d9b6bb4750b698a04d011b4acf">10 minutes&nbsp;ago</a>, <a href="/Niners/evildictaitor">evildictaitor</a> wrote</p><p>This sounds like something you should take up with the C&#43;&#43; standards&nbsp;committee. They decide how the&nbsp;language&nbsp;works.</p><p></p></div></blockquote><p></p><p>I would rather Microsoft go the route of Microsoft extensions to the standard..&nbsp; And I assume the organization of a C&#43;&#43; project is not something the C&#43;&#43; standards commitee deals with.&nbsp; I asked about organizing code in a project with sub folders. <br><a href="http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/f9d51ab4-a7ff-46e2-9471-143536e0d2be">http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/f9d51ab4-a7ff-46e2-9471-143536e0d2be</a></p><p>You can add filters to C&#43;&#43; project source files and header files. They are kind of like logical folders in that they organize the code for you, but do not actually create a sub folder in the file system.</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/8c575611c134463cb690a04d01209e3b#8c575611c134463cb690a04d01209e3b</link>
		<pubDate>Thu, 10 May 2012 17:30:49 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/8c575611c134463cb690a04d01209e3b#8c575611c134463cb690a04d01209e3b</guid>
		<dc:creator>Steve Richter</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SteveRichter/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>Raymond Chen puts it better than I can (<a href="http://blogs.msdn.com/b/oldnewthing/archive/2012/01/13/10256146.aspx">http://blogs.msdn.com/b/oldnewthing/archive/2012/01/13/10256146.aspx</a>):</p><p>I always find it interesting when people say &quot;I wish that Microsoft would stop following standards,&quot;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/b53f0830c3b64858a0a7a04d0127247a#b53f0830c3b64858a0a7a04d0127247a</link>
		<pubDate>Thu, 10 May 2012 17:54:34 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/b53f0830c3b64858a0a7a04d0127247a#b53f0830c3b64858a0a7a04d0127247a</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>Extension methods is one of my least favorite features in C#, they are a hack to inject functionality into something that doesn't have it. Mixins can be a better choice sometimes, and you can do that in C&#43;&#43;.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/856345930ad04f57bad6a04d0128160c#856345930ad04f57bad6a04d0128160c</link>
		<pubDate>Thu, 10 May 2012 17:58:00 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/856345930ad04f57bad6a04d0128160c#856345930ad04f57bad6a04d0128160c</guid>
		<dc:creator>Ion Todirel</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Ion Todirel/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/856345930ad04f57bad6a04d0128160c">15 minutes&nbsp;ago</a>, <a href="/Niners/Ion%20Todirel">Ion&nbsp;Todirel</a> wrote</p><p>Extension methods is one of my least favorite features in C#, they are a hack to inject functionality into something that doesn't have it. Mixins can be a better choice sometimes, and you can do that in C&#43;&#43;.</p><p></p></div></blockquote><p></p><p>a mixin is created by creating a new class that is based on the class being extended?</p><p><a href="http://www.jakesee.com/2009/04/c-mixins-a-powerful-concept/">http://www.jakesee.com/2009/04/c-mixins-a-powerful-concept/</a></p><p>I have a class library that is returning an instance of a class. How to apply the mixin pattern to an object that already exists?</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/af050eddfd8645f29c63a04d012dc5b6#af050eddfd8645f29c63a04d012dc5b6</link>
		<pubDate>Thu, 10 May 2012 18:18:43 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/af050eddfd8645f29c63a04d012dc5b6#af050eddfd8645f29c63a04d012dc5b6</guid>
		<dc:creator>Steve Richter</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SteveRichter/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/b53f0830c3b64858a0a7a04d0127247a">24 minutes&nbsp;ago</a>, <a href="/Niners/evildictaitor">evildictaitor</a> wrote</p><p>Raymond Chen puts it better than I can (<a href="http://blogs.msdn.com/b/oldnewthing/archive/2012/01/13/10256146.aspx">http://blogs.msdn.com/b/oldnewthing/archive/2012/01/13/10256146.aspx</a>):</p><p>I always find it interesting when people say &quot;I wish that Microsoft would stop following standards,&quot;</p><p></p></div></blockquote><p></p><p>no, I want Microsoft to adhere to standards. But I also want them to provide extensions. in my case, the code I use comes from all platforms. The code I write only needs to run on Windows.</p><p>Edit:&nbsp; I want Microsoft to make it easier for me to write and organize my code.&nbsp; As it is, using C&#43;&#43; is more wrestling than coding.</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/52f801efacd140d1acb4a04d012e9506#52f801efacd140d1acb4a04d012e9506</link>
		<pubDate>Thu, 10 May 2012 18:21:40 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/52f801efacd140d1acb4a04d012e9506#52f801efacd140d1acb4a04d012e9506</guid>
		<dc:creator>Steve Richter</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SteveRichter/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/af050eddfd8645f29c63a04d012dc5b6">1 hour&nbsp;ago</a>, <a href="/Niners/SteveRichter">SteveRichter</a> wrote</p><p>*snip*</p><p>a mixin is created by creating a new class that is based on the class being extended?</p><p><a href="http://www.jakesee.com/2009/04/c-mixins-a-powerful-concept/">http://www.jakesee.com/2009/04/c-mixins-a-powerful-concept/</a></p><p>I have a class library that is returning an instance of a class. How to apply the mixin pattern to an object that already exists?</p><p>&nbsp;</p></div></blockquote><p></p><p>Indeed, mixins, at least the mixins I've seen are no substitute for extension methods at all.</p><p>I like the |&gt; pipe operator in F# but in terms of tool and user friendliness, nothing beats extension methods. Dot dot dot...</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/61c9a8a8d4504b7ab940a04d0144a50c#61c9a8a8d4504b7ab940a04d0144a50c</link>
		<pubDate>Thu, 10 May 2012 19:41:59 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/61c9a8a8d4504b7ab940a04d0144a50c#61c9a8a8d4504b7ab940a04d0144a50c</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>Herb has mentioned several times that extension methods are coming soon in the standard.&nbsp; One of his recent talks showed off an example of [currently Microsoft only] extension methods.&nbsp; (I forgot exactly which one that was ... )</p><p>EDIT -- Never mind -- I was thinking of partial classes, not extension methods...</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/ebd184256ebf48dfae23a04d01537849#ebd184256ebf48dfae23a04d01537849</link>
		<pubDate>Thu, 10 May 2012 20:35:58 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/ebd184256ebf48dfae23a04d01537849#ebd184256ebf48dfae23a04d01537849</guid>
		<dc:creator>ryanb</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/ryanb/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/C-needs-extension-methods#cebd184256ebf48dfae23a04d01537849">ryanb</a>: I'm not sure this is correct, actually, but I'll ask Herb...</p><p>C</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/6b332df78be14c30ba39a04d01597526#6b332df78be14c30ba39a04d01597526</link>
		<pubDate>Thu, 10 May 2012 20:57:46 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/6b332df78be14c30ba39a04d01597526#6b332df78be14c30ba39a04d01597526</guid>
		<dc:creator>Charles</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Charles/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/52f801efacd140d1acb4a04d012e9506">3 hours&nbsp;ago</a>, <a href="/Niners/SteveRichter">SteveRichter</a> wrote</p><p>*snip*</p><p>no, I want Microsoft to adhere to standards. But I also want them to provide extensions</p><p></p></div></blockquote><p></p><p>You can't have it both ways. Either Microsoft conforms to standards and doesn't provide&nbsp;extensions, or it provides&nbsp;extensions&nbsp;that don't conform to standards.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/e5c5043536744f35b926a04d0165ecb4#e5c5043536744f35b926a04d0165ecb4</link>
		<pubDate>Thu, 10 May 2012 21:43:09 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/e5c5043536744f35b926a04d0165ecb4#e5c5043536744f35b926a04d0165ecb4</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>gcc has many extensions to C and C&#43;&#43;, and that's fine IMO. You just need to support the standard, and provide a strict standards mode flag (eg: gcc -ansi ...). That way people who need compiler portability can still use the compiler (and verify that they are writing standards compliant code).</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/2bdad051c31c4820bb74a04d0171a119#2bdad051c31c4820bb74a04d0171a119</link>
		<pubDate>Thu, 10 May 2012 22:25:46 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/2bdad051c31c4820bb74a04d0171a119#2bdad051c31c4820bb74a04d0171a119</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/2bdad051c31c4820bb74a04d0171a119">40 minutes&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>You just need to support the standard, and provide a strict standards mode flag&nbsp;</p><p></p></div></blockquote><p></p><p>Internet Explorer tried that, and they get endless criticism for doing so.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/dc67851f0fdc464d86aea04d017cdab3#dc67851f0fdc464d86aea04d017cdab3</link>
		<pubDate>Thu, 10 May 2012 23:06:38 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/dc67851f0fdc464d86aea04d017cdab3#dc67851f0fdc464d86aea04d017cdab3</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/dc67851f0fdc464d86aea04d017cdab3">13 minutes&nbsp;ago</a>, <a href="/Niners/evildictaitor">evildictaitor</a> wrote</p><p>*snip*</p><p>Internet Explorer tried that, and they get endless criticism for doing so.</p><p></p></div></blockquote><p></p><p>Users can run code compiled by a standards non compliant compiler. They can't use a web site that does not conform to their browser.</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/fc95bd95f09e420ca111a04d01818609#fc95bd95f09e420ca111a04d01818609</link>
		<pubDate>Thu, 10 May 2012 23:23:38 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/fc95bd95f09e420ca111a04d01818609#fc95bd95f09e420ca111a04d01818609</guid>
		<dc:creator>Steve Richter</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SteveRichter/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>I don't think Microsoft C&#43;&#43; doesn't extend standard C&#43;&#43; anyway. What about C&#43;&#43;/CLI? Also you should add extensions in such a way that it doesn't break standard compliant code. The point is if I write standard compliant code, it should work in standard compliant browser/compiler. Not that I can't write standard compliant code.</p><p>IE does support web standards really well these days, while still supporting IE-only extensions. That's fine.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/b607d15cb0e84361bbaca04e000afcb4#b607d15cb0e84361bbaca04e000afcb4</link>
		<pubDate>Fri, 11 May 2012 00:40:00 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/b607d15cb0e84361bbaca04e000afcb4#b607d15cb0e84361bbaca04e000afcb4</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>I still think the way extensions in C# was implemented&nbsp;is wrong. It looks and feels like they could not really come up with an ideal syntax and ended up with the awkward result we have today. My suggestion is to do&nbsp;it this way:</p><p><pre class="brush: csharp">public static extension class string
{
    /// &lt;summary&gt;
    /// Shows how a method is implemented
    /// &lt;/summary&gt;
    public int GetWordCount()
    {
         var wordCount = 0;
         // Code that counts words
         return wordCount;
    }

    /// &lt;summary&gt; 
    /// Shows how a property is implemented
    ///&lt;/summary&gt;
    public int WordCount
    {
        get 
        { 
             var wordCount = 0; 
             // Code that counts words
             return wordCount;
        }
    }
}</pre></p><p>Other than the &quot;extension&quot; keyword, it is identical to how the &quot;partial&quot; keyword works. Of course the extension keyword will cause the compiler to impose extension-specific rules. For instance, you can't add fields to the extension class. Doing so will result in a compiler error.</p><p>In addition, the compiler will handle the &quot;this&quot; pointer automatically, and a NullReferenceException will be thrown if you try to access an extension method/property when the object is null. So if I type...</p><p><pre class="brush: csharp">string nullString = null;
var wordCount = nullString.WordCount;</pre></p><p>...I will get a NullReferenceException thrown just like I would if I called any other method on it.</p><p>The advantage is that we don't have to deal with the current&nbsp;awkward syntax that itself can't handle properties. I remember reading&nbsp;somewhere that supposedly the reason that extensions do not support properties is because they could not come up with satisfactory syntax to do it.</p><p>BTW this also allows you to create static methods.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/4e2c27be48124ab3b6c9a04e000ec694#4e2c27be48124ab3b6c9a04e000ec694</link>
		<pubDate>Fri, 11 May 2012 00:53:47 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/4e2c27be48124ab3b6c9a04e000ec694#4e2c27be48124ab3b6c9a04e000ec694</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/b607d15cb0e84361bbaca04e000afcb4">28 minutes&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>What about C&#43;&#43;/CLI?&nbsp;</p><p></p></div></blockquote><p></p><p>That's not C&#43;&#43;.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/93922f08da834597978da04e00130c33#93922f08da834597978da04e00130c33</link>
		<pubDate>Fri, 11 May 2012 01:09:21 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/93922f08da834597978da04e00130c33#93922f08da834597978da04e00130c33</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/4e2c27be48124ab3b6c9a04e000ec694">15 minutes&nbsp;ago</a>, <a href="/Niners/BitFlipper">BitFlipper</a> wrote</p><p>BTW this also allows you to create static methods.</p><p></p></div></blockquote><p></p><p>Static extension methods don't make sense, because extension methods are syntactic sugar around being able to use the &quot;.&quot; notation on an object. Static methods don't use that &quot;.&quot; so there's no point.</p><p>class StringHelpers {&nbsp;</p><p>static int StringToIntDoesntNeedToBeAnExtensionMethod(string str)<br>{<br>&nbsp; return int.Parse(str);<br>}</p><p>int ButItDoesIfItRequiresDotSyntax(this string str)<br>{<br>&nbsp; return int.Parse(str);<br>}&nbsp;</p><p>void Main()<br>{</p><p>&nbsp; int i =&nbsp;StringToIntDoesntNeedToBeAnExtensionMethod(&quot;foo&quot;);</p><p>&nbsp; int j = &quot;foo&quot;.ButItDoesIfItRequiresDotSyntax();<br>}&nbsp;</p><p>}&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/b6bc7876fd2c4a77972aa04e0013f9b5#b6bc7876fd2c4a77972aa04e0013f9b5</link>
		<pubDate>Fri, 11 May 2012 01:12:43 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/b6bc7876fd2c4a77972aa04e0013f9b5#b6bc7876fd2c4a77972aa04e0013f9b5</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/93922f08da834597978da04e00130c33">2 minutes&nbsp;ago</a>, <a href="/Niners/evildictaitor">evildictaitor</a> wrote</p><p>*snip*</p><p>That's not C&#43;&#43;.</p><p></p></div></blockquote><p></p><p>They still extend C&#43;&#43;, though. There are various MS-specific #pragmas, some behaviours that deviate from the standard, various __ keywords like __declspec (those may be allowed by the standard, but using them still breaks portability), the COM smart pointer #import directive, and I'm sure there's more I'm forgetting right now.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/729954cb8e3a4e5caf64a04e0014f111#729954cb8e3a4e5caf64a04e0014f111</link>
		<pubDate>Fri, 11 May 2012 01:16:14 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/729954cb8e3a4e5caf64a04e0014f111#729954cb8e3a4e5caf64a04e0014f111</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/C-needs-extension-methods#cb6bc7876fd2c4a77972aa04e0013f9b5">evildictaitor</a>:</p><p>We must go deep into the philosophy of what it means to be a type. Methods can naturally belong to classes, while fields belong to objects.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/0ee852a60bad4e3a87c8a04e0017b5be#0ee852a60bad4e3a87c8a04e0017b5be</link>
		<pubDate>Fri, 11 May 2012 01:26:19 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/0ee852a60bad4e3a87c8a04e0017b5be#0ee852a60bad4e3a87c8a04e0017b5be</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/729954cb8e3a4e5caf64a04e0014f111">6 minutes&nbsp;ago</a>, <a href="/Niners/Sven%20Groot">Sven&nbsp;Groot</a> wrote</p><p>They still extend C&#43;&#43;, though.</p><p></p></div></blockquote><p></p><p>That's true (tbh I'm not sure a standards compliant C&#43;&#43; exists at all). But that doesn't mean making it <em>less</em> standards compliant would make it better.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/b759cb7358b9491b9fc2a04e00190232#b759cb7358b9491b9fc2a04e00190232</link>
		<pubDate>Fri, 11 May 2012 01:31:03 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/b759cb7358b9491b9fc2a04e00190232#b759cb7358b9491b9fc2a04e00190232</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>Standards compliant means it implements the standard. Mac OS X is POSIX compliant even though it has an entire universe of APIs besides POSIX. No POSIX-compliant OS <em>just</em> implements POSIX. Web standards are much the same. Good browser developers try not to pollute the namespace with browser-specific extensions though (ie: prefix with moz or webkit).</p><p>The point of standards is that there is a common baseline that just works. If I write standard compliant code I expert it to work on all standard compliant platforms (if that be compilers, OSes, browsers, etc.). This is very helpful for portability, having the baseline with clearly defined boundaries. But it does not mean every platform has to be bit-for-bit the same interface. </p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/303bd2d0fb304f58ad24a04e001a08f9#303bd2d0fb304f58ad24a04e001a08f9</link>
		<pubDate>Fri, 11 May 2012 01:34:47 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/303bd2d0fb304f58ad24a04e001a08f9#303bd2d0fb304f58ad24a04e001a08f9</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/303bd2d0fb304f58ad24a04e001a08f9">7 minutes&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>Standards compliant means it implements the standard.</p><p></p></div></blockquote><p></p><p>No, it means that it complies the standard. The C&#43;&#43; standard includes as normative the C&#43;&#43; grammar and parsing rules, so anyone who extends that is not standards compliant.</p><p></p><blockquote><div class="quoteText"><p></p><p>Mac OS X is POSIX compliant even though it has an entire universe of APIs besides POSIX.</p><p></p></div></blockquote><p></p><p>So is Windows <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' /></p><p></p><blockquote><div class="quoteText"><p></p><p>Web standards are much the same.</p><p></p></div></blockquote><p></p><p>Web standards don't exist. Nobody owns the web. On the other hand, C&#43;&#43; is an ISO standard.</p><p></p><blockquote><div class="quoteText"><p></p><p>The point of standards is that there is a common baseline that just works.&nbsp;</p><p></p></div></blockquote><p></p><p>The point of standards is to be standard. If I write some code on my standards compliant machine it should succeed or fail in the same way on your standards complaint machine.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/bd00e720c6ab4e35b0a0a04e001cf8df#bd00e720c6ab4e35b0a0a04e001cf8df</link>
		<pubDate>Fri, 11 May 2012 01:45:29 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/bd00e720c6ab4e35b0a0a04e001cf8df#bd00e720c6ab4e35b0a0a04e001cf8df</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/C-needs-extension-methods#c4e2c27be48124ab3b6c9a04e000ec694">BitFlipper</a>: In your example, where is the field &quot;wordCount&quot; declared? And how is it declared? Is it a static field? If it is, then it's useless since all instances would share the same value. If it's not static, how can this static extension class reference it?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/e521929ce39245a297f4a04e0021381b#e521929ce39245a297f4a04e0021381b</link>
		<pubDate>Fri, 11 May 2012 02:00:56 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/e521929ce39245a297f4a04e0021381b#e521929ce39245a297f4a04e0021381b</guid>
		<dc:creator>cbae</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/cbae/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/C-needs-extension-methods#cbd00e720c6ab4e35b0a0a04e001cf8df">evildictaitor</a>:</p><p>I think it's fine as long as there is a way to enforce strict standards compliance (eg: a compiler switch). Just my opinion.</p><p>In school for C code we used to pass the -ansi flag to gcc to ensure strict[er] standards compliance. I've never seen that done in the &quot;real world&quot; yet, since project design often guaranteed to use a specific compiler and platform anyway.</p><p>Apparently you can get finer grained than that with the -std flag. gcc also <a href="http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html#C-Extensions">documents all it's extensions</a>, which is nice (and educational, I think).</p><p>It's interesting that the Linux kernel actually uses many of these extensions, so gcc is typically the only compiler that can reliably compile Linux. Although Clang has been implemented many of gcc's extensions and <a href="http://lwn.net/Articles/411654/">has made a lot of progress in this</a>.<br><br>So anyway I think the point is, extensions to standard languages are pretty common and not very controversial.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/1aacd61b6f214f348405a04e00229d19#1aacd61b6f214f348405a04e00229d19</link>
		<pubDate>Fri, 11 May 2012 02:06:01 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/1aacd61b6f214f348405a04e00229d19#1aacd61b6f214f348405a04e00229d19</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/C-needs-extension-methods#cb6bc7876fd2c4a77972aa04e0013f9b5">evildictaitor</a>:</p><p>It makes sense when you want to do something like:</p><p>public static extension class string<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;public static string Longest(string s1, string s2)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (s1 == null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return s2;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (s2 == null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return s1;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return s1.Length &gt;= s2.Length ? s1 : s2;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}</p><p>...or...</p><p>public static extension&nbsp;struct float<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;public static float[] FromPcm16(Int16[] srcBuffer)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var dstBuffer = new float[srcBuffer.Length];<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Convert to float...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return dstBuffer;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}</p><p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/e521929ce39245a297f4a04e0021381b">44 minutes ago</a>, <a href="/Niners/cbae">cbae</a> wrote</p><p>@<a href="/Forums/Coffeehouse/C-needs-extension-methods#c4e2c27be48124ab3b6c9a04e000ec694">BitFlipper</a>: In your example, where is the field &quot;wordCount&quot; declared? And how is it declared? Is it a static field? If it is, then it's useless since all instances would share the same value. If it's not static, how can this static extension class reference it?</p><p></p></div></blockquote><p></p><p>You misunderstood the example.&quot;wordCount&quot; is not a field, it is a local variable inside the method (or property) that is used to calculate the number of words. That is why I specifically said you will get a compiler error if you try to add field members. I'll edit the example to make it more clear.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/2efdc42e76334b698610a04e002d5338#2efdc42e76334b698610a04e002d5338</link>
		<pubDate>Fri, 11 May 2012 02:45:01 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/2efdc42e76334b698610a04e002d5338#2efdc42e76334b698610a04e002d5338</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>In principle, I agree that language extensions aren't evil as long as the compiler (or browser) adheres to the standard. In practice, it's a bad idea.</p><p>Assuming that you design an useful feature, based on an actual need, there are several possible disasters that might happen:</p><p>- the relevant standard body decides to implement that feature, but with a different syntax. Politics aside, that's quite likely to happen as nobody is perfect and they have the 20/20 hindsight your implementation provides. You end up with a compiler that implements the same feature in two different ways, one of which (yours) is considered inferior. Ouch.</p><p>- the standard body decides to implement that feature, but with different semantics. You have to decide whether it's better to break everybody's code and documentation or fail to implement the standard correctly.</p><p>- Worst of all: the standard body decides to implement an unrelated, but more visible&nbsp;feature whose syntax&nbsp;clashes with yours. Good luck fixing that.</p><p>If the browser wars taught us anything is that the only way to properly extend a standard is to participate and put pressure on the committees. With a big smile, of course.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/3ac124fc46e54576ad35a04e00368a26#3ac124fc46e54576ad35a04e00368a26</link>
		<pubDate>Fri, 11 May 2012 03:18:34 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/3ac124fc46e54576ad35a04e00368a26#3ac124fc46e54576ad35a04e00368a26</guid>
		<dc:creator>Blue Ink</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Blue Ink/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/1aacd61b6f214f348405a04e00229d19">59 minutes&nbsp;ago</a>, <a href="/Niners/Bass">Bass</a> wrote</p><p>@<a href="/Forums/Coffeehouse/C-needs-extension-methods#cbd00e720c6ab4e35b0a0a04e001cf8df">evildictaitor</a>:</p><p>I think it's fine as long as there is a way to enforce strict standards compliance (eg: a compiler switch). Just my opinion.</p><p>In school for C code we used to pass the -ansi flag to gcc to ensure strict[er] standards compliance. I've never seen that done in the &quot;real world&quot; yet, since project design often guaranteed to use a specific compiler and platform anyway.</p><p>Apparently you can get finer grained than that with the -std flag. gcc also <a href="http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html#C-Extensions">documents all it's extensions</a>, which is nice (and educational, I think).</p><p>It's interesting that the Linux kernel actually uses many of these extensions, so gcc is typically the only compiler that can reliably compile Linux. Although Clang has been implemented many of gcc's extensions and <a href="http://lwn.net/Articles/411654/">has made a lot of progress in this</a>.<br><br>So anyway I think the point is, extensions to standard languages are pretty common and not very controversial.</p><p></p></div></blockquote><p></p><p>I think you have a good point here.</p><p>I also like the way you can switch on extensions for GHC.</p><p>There was also quite some negative reactions to some new WinRT extensions for C&#43;&#43; in one or more video posts on this site - but why, if it's restricted to a switchable compiler extension (which admittedly, I'm assuming it is).</p><p>As for extension methods, I seem to remember D having something close to it, where you can declare a function on a type, including a primitive type and instead of calling it like foo(x) you can say x.foo. But that's more like an extension property.</p><p>Anyway, there are good uses and probably not so good uses for extension methods but look at LINQ and how useful they are there. Also, don't extension methods prevent you from using implementation details (no access to private and protected parts)? This makes them just syntactic sugar for static functions and how can one argue against those?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/10c4a288250e48c1b172a04e003971b3#10c4a288250e48c1b172a04e003971b3</link>
		<pubDate>Fri, 11 May 2012 03:29:08 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/10c4a288250e48c1b172a04e003971b3#10c4a288250e48c1b172a04e003971b3</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/C-needs-extension-methods#c3ac124fc46e54576ad35a04e00368a26">Blue Ink</a>: The way to avoid the second and third problem is to stick to keywords that the standard reserves for extensions (in C&#43;&#43;, this is any keyword or identifier starting with __ or _ and a capital; in CSS the equivelent is the -ms and -moz prefixes I guess).</p><p>The disadvantage there is that it can lead to horribly ugly syntax (witness the first version of Managed C&#43;&#43;).</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/386cc44a29cc4ea9bb49a04e003b183e#386cc44a29cc4ea9bb49a04e003b183e</link>
		<pubDate>Fri, 11 May 2012 03:35:09 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/386cc44a29cc4ea9bb49a04e003b183e#386cc44a29cc4ea9bb49a04e003b183e</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/2efdc42e76334b698610a04e002d5338">52 minutes&nbsp;ago</a>, <a href="/Niners/BitFlipper">BitFlipper</a> wrote</p><p>public static extension class string</p><p>{<br>&nbsp;&nbsp;&nbsp;&nbsp;public static string Longest(string s1, string s2)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (s1 == null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return s2;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (s2 == null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return s1;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return s1.Length &gt;= s2.Length ? s1 : s2;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}</p><p>...or...</p><p>public static extension&nbsp;struct float<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;public static float[] FromPcm16(Int16[] srcBuffer)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var dstBuffer = new float[srcBuffer.Length];<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Convert to float...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return dstBuffer;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}</p><p></p></div></blockquote><p></p><p>What's wrong with&nbsp;</p><p>public static class StringHelper</p><p>{<br>&nbsp;&nbsp;&nbsp;&nbsp;public static string Longest(string s1, string s2)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (s1 == null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return s2;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (s2 == null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return s1;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return s1.Length &gt;= s2.Length ? s1 : s2;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}</p><p>...or...</p><p>public static struct FloatHelper<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;public static float[] FromPcm16(Int16[] srcBuffer)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var dstBuffer = new float[srcBuffer.Length];<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Convert to float...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return dstBuffer;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/176501b4944a4afcbdf1a04e003c7768#176501b4944a4afcbdf1a04e003c7768</link>
		<pubDate>Fri, 11 May 2012 03:40:09 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/176501b4944a4afcbdf1a04e003c7768#176501b4944a4afcbdf1a04e003c7768</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/C-needs-extension-methods#c176501b4944a4afcbdf1a04e003c7768">evildictaitor</a>:</p><p>Then why have extension methods at all when helper classes is all we need?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/997e124091b54cc9ac02a04e00577694#997e124091b54cc9ac02a04e00577694</link>
		<pubDate>Fri, 11 May 2012 05:18:26 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/997e124091b54cc9ac02a04e00577694#997e124091b54cc9ac02a04e00577694</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/997e124091b54cc9ac02a04e00577694">40 minutes&nbsp;ago</a>, <a href="/Niners/BitFlipper">BitFlipper</a> wrote</p><p>@<a href="/Forums/Coffeehouse/C-needs-extension-methods#c176501b4944a4afcbdf1a04e003c7768">evildictaitor</a>:</p><p>Then why have extension methods at all when helper classes is all we need?</p><p></p></div></blockquote><p></p><p>The difference is that invoking a method as if it was an instance method if it logically operates on that instance has actual readability benefits (especially in the context of LINQ, which the feature was invented for), e.g. list.Where(condition) vs. Enumerable.Where(list, condition), whereas the difference between writing&nbsp;String.Longest&nbsp;or StringHelper.Longest isn't that great.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/fc87b07ec2bb476bb15da04e00632fb7#fc87b07ec2bb476bb15da04e00632fb7</link>
		<pubDate>Fri, 11 May 2012 06:01:07 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/fc87b07ec2bb476bb15da04e00632fb7#fc87b07ec2bb476bb15da04e00632fb7</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>Well static methods wasn't my main point, I just threw it in to show that such features can be readily added using the suggested syntax,&nbsp;while the current&nbsp;syntax makes such features difficult.&nbsp;What would extension properties look like using the existing syntax? Nobody knows because it just doesn't work with what we have now.&nbsp;The&nbsp;syntax I am suggesting&nbsp;does not have&nbsp;this problem because&nbsp;it is pretty obvious what properties would look like.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/9b1e7d06a8a745229f85a04e0072cca0#9b1e7d06a8a745229f85a04e0072cca0</link>
		<pubDate>Fri, 11 May 2012 06:57:58 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/9b1e7d06a8a745229f85a04e0072cca0#9b1e7d06a8a745229f85a04e0072cca0</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/C-needs-extension-methods#c9b1e7d06a8a745229f85a04e0072cca0">BitFlipper</a>: Oh yeah, I definitely agree that there could've been better syntax for declaring them (like the &quot;extension class&quot; idea).</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/0e1d0cf5d47e437d9f1ba04e00795c01#0e1d0cf5d47e437d9f1ba04e00795c01</link>
		<pubDate>Fri, 11 May 2012 07:21:51 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/0e1d0cf5d47e437d9f1ba04e00795c01#0e1d0cf5d47e437d9f1ba04e00795c01</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/4e2c27be48124ab3b6c9a04e000ec694">11 hours&nbsp;ago</a>, <a href="/Niners/BitFlipper">BitFlipper</a> wrote</p><p>I still think the way extensions in C# was implemented&nbsp;is wrong. It looks and feels like they could not really come up with an ideal syntax and ended up with the awkward result we have today. My suggestion is to do&nbsp;it this way:</p><div class="syntaxhighlighterHolder"><div id="highlighter_747792" class="syntaxhighlighter csharp ie"><table border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="gutter"><div class="line number1 index0 alt2">1</div><div class="line number2 index1 alt1">2</div><div class="line number3 index2 alt2">3</div><div class="line number4 index3 alt1">4</div><div class="line number5 index4 alt2">5</div><div class="line number6 index5 alt1">6</div><div class="line number7 index6 alt2">7</div><div class="line number8 index7 alt1">8</div><div class="line number9 index8 alt2">9</div><div class="line number10 index9 alt1">10</div><div class="line number11 index10 alt2">11</div><div class="line number12 index11 alt1">12</div><div class="line number13 index12 alt2">13</div><div class="line number14 index13 alt1">14</div><div class="line number15 index14 alt2">15</div><div class="line number16 index15 alt1">16</div><div class="line number17 index16 alt2">17</div><div class="line number18 index17 alt1">18</div><div class="line number19 index18 alt2">19</div><div class="line number20 index19 alt1">20</div><div class="line number21 index20 alt2">21</div><div class="line number22 index21 alt1">22</div><div class="line number23 index22 alt2">23</div><div class="line number24 index23 alt1">24</div><div class="line number25 index24 alt2">25</div></td><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="csharp keyword">public</code> <code class="csharp keyword">static</code> <code class="csharp plain">extension </code><code class="csharp keyword">class</code> <code class="csharp keyword">string</code></div><div class="line number2 index1 alt1"><code class="csharp plain">{</code></div><div class="line number3 index2 alt2"><code class="csharp spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="csharp color1">/// &lt;summary&gt;</code></div><div class="line number4 index3 alt1"><code class="csharp spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="csharp color1">/// Shows how a method is implemented</code></div><div class="line number5 index4 alt2"><code class="csharp spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="csharp color1">/// &lt;/summary&gt;</code></div><div class="line number6 index5 alt1"><code class="csharp spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="csharp keyword">public</code> <code class="csharp keyword">int</code> <code class="csharp plain">GetWordCount()</code></div><div class="line number7 index6 alt2"><code class="csharp spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="csharp plain">{</code></div><div class="line number8 index7 alt1"><code class="csharp spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="csharp plain">var wordCount = 0;</code></div><div class="line number9 index8 alt2"><code class="csharp spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="csharp comments">// Code that counts words</code></div><div class="line number10 index9 alt1"><code class="csharp spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="csharp keyword">return</code> <code class="csharp plain">wordCount;</code></div><div class="line number11 index10 alt2"><code class="csharp spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="csharp plain">}</code></div><div class="line number12 index11 alt1">&nbsp;</div><div class="line number13 index12 alt2"><code class="csharp spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code></div><div class="line number25 index24 alt2"><code class="csharp plain">}</code></div></div></td></tr></tbody></table></div></div><p>&nbsp;</p><p></p></div></blockquote><p></p><p>keep in mind that extension methods&nbsp;apply to all types, like enums and interfaces.</p><p>Also, I like that an extension method can be called on a this value that is null.</p><p>For a lot of the classes I create I code two extension methods. One, named &quot;ToXElement&quot; returns the object in XElement form. The 2nd, named &quot;[ClassName]OrDefault&quot; is an extension of XElement and returns the object instance from an XElement.&nbsp; Being able to test for null in an extension method is great when going from XElement to object because you never know if the XDocument contains your XElement or not. And these two methods belong in the same source file with the class they are extending, despite one apply to XElement and the other to the actual class.</p><p>&nbsp;</p><p></p><pre class="brush: text">  public static class PresentationSpaceExt  {    public static XElement ToXElement(this PresentationSpace Space, XName Name)    {      if (Space == null)        return new XElement(Name, null);      else      {        XElement xe = new XElement(Name,             new XElement(&quot;Fields&quot;,               from c in Space.Fields               select c.ToXElement(&quot;Field&quot;)),               Space.Dim.ToXElement(&quot;Dim&quot;),               Space.CursorLocation.ToXElement(&quot;CursorLocation&quot;)          );        return xe;      }    }    public static PresentationSpace PresentationSpaceOrDefault(      this XElement Elem, XNamespace ns, PresentationSpace Default = null)    {      if (Elem == null)        return Default;      else      {        var dim = Elem.Element(&quot;Dim&quot;).PresentationSpaceDimOrDefault(ns, null);        var loc = Elem.Element(&quot;CursorLocation&quot;).DisplayLocationOrDefault(ns, null);        var flds =        from sam in Elem.Element(ns &#43; &quot;Fields&quot;)          .Elements(ns &#43; &quot;Field&quot;)          select sam.PresentationSpaceFieldOrDefault(ns, null) ;        var ps = new PresentationSpace(loc, dim, flds);        return ps;      }    }  }</pre><p></p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/0e09783244774daba28da04e00d29339#0e09783244774daba28da04e00d29339</link>
		<pubDate>Fri, 11 May 2012 12:46:40 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/0e09783244774daba28da04e00d29339#0e09783244774daba28da04e00d29339</guid>
		<dc:creator>Steve Richter</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SteveRichter/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>The real solution is to take away the sealed keyword. Then you can subclass and add whatever you want. Extension methods just confuse things, imo.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/65c4bc4085c24ef58f42a04e00dc386a#65c4bc4085c24ef58f42a04e00dc386a</link>
		<pubDate>Fri, 11 May 2012 13:21:47 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/65c4bc4085c24ef58f42a04e00dc386a#65c4bc4085c24ef58f42a04e00dc386a</guid>
		<dc:creator>Scott</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/spivonious/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/65c4bc4085c24ef58f42a04e00dc386a">59 seconds&nbsp;ago</a>, <a href="/Niners/spivonious">spivonious</a> wrote</p><p>The real solution is to take away the sealed keyword. Then you can subclass and add whatever you want. Extension methods just confuse things, imo.</p><p></p></div></blockquote><p></p><p>Extension methods were&nbsp;added primarily for LINQ. LINQ requires that certain methods are available on all types that implement IEnumerable&lt;T&gt; or IQueryable&lt;T&gt;. Just subclassing doesn't solve that problem, as every pre-existing list type would have to be subclassed to support LINQ in that case. And since C# doesn't support multiple inheritance, an implementation would have to written for all of them.</p><p>Similarly, would deriving from the String class allow you to do &quot;foo&quot;.SomeMethod()? No, because string literals still aren't an instance of that class. Same if you want to use the method on an object retrieved from another source (e.g. a method in third-party code returning an instance) which wouldn't be an instance of your derived class.</p><p>Extension methods solve a different problem than derived classes. And the sealed keyword exists for good reason: some things just aren't suitable to be extension points.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/d135bb22f4fa423b9b23a04e00ddfcd0#d135bb22f4fa423b9b23a04e00ddfcd0</link>
		<pubDate>Fri, 11 May 2012 13:28:13 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/d135bb22f4fa423b9b23a04e00ddfcd0#d135bb22f4fa423b9b23a04e00ddfcd0</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/6b332df78be14c30ba39a04d01597526">17 hours&nbsp;ago</a>, <a href="/Niners/Charles">Charles</a> wrote</p><p>@<a href="/Forums/Coffeehouse/C-needs-extension-methods#cebd184256ebf48dfae23a04d01537849">ryanb</a>: I'm not sure this is correct, actually, but I'll ask Herb...</p><p>C</p><p></p></div></blockquote><p></p><p>You're right Charles.&nbsp; I realize now that I was thinking about partial classes, not extension methods.&nbsp; I retract my previous statement.&nbsp; And I should have been more clear about all of this as things that MIGHT be coming in the standard at some point.&nbsp; Never mind.&nbsp; Nothing to see here.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/eda777f589bd40ec988ba04e00e9af31#eda777f589bd40ec988ba04e00e9af31</link>
		<pubDate>Fri, 11 May 2012 14:10:49 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/eda777f589bd40ec988ba04e00e9af31#eda777f589bd40ec988ba04e00e9af31</guid>
		<dc:creator>ryanb</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/ryanb/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/C-needs-extension-methods#c0e09783244774daba28da04e00d29339">SteveRichter</a>:</p><p>Then maybe a modification to the extension class idea can be to allow something&nbsp;like this:</p><p><pre class="brush: csharp">if (this == null)
    ...</pre></p><p>...to do what you describe. In that case the NullReferenceException&nbsp;will not be&nbsp;thrown when calling the extension method itself, but when actually trying to use &quot;this&quot; either explicitly or implicitly (like calling a non-static method etc).</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/4029720abf3f405ca514a04e00f7d82d#4029720abf3f405ca514a04e00f7d82d</link>
		<pubDate>Fri, 11 May 2012 15:02:22 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/4029720abf3f405ca514a04e00f7d82d#4029720abf3f405ca514a04e00f7d82d</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/C-needs-extension-methods#ceda777f589bd40ec988ba04e00e9af31">ryanb</a>: And Herb told me that there is not much momentum behind extension methods in the ISO committee...</p><p>C</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/39f67446648846f2957ca04e010aaf3d#39f67446648846f2957ca04e010aaf3d</link>
		<pubDate>Fri, 11 May 2012 16:10:58 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/39f67446648846f2957ca04e010aaf3d#39f67446648846f2957ca04e010aaf3d</guid>
		<dc:creator>Charles</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Charles/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/39f67446648846f2957ca04e010aaf3d">15 minutes&nbsp;ago</a>, <a href="/Niners/Charles">Charles</a> wrote</p><p>@<a href="/Forums/Coffeehouse/C-needs-extension-methods#ceda777f589bd40ec988ba04e00e9af31">ryanb</a>: And Herb told me that there is not much momentum behind extension methods in the ISO committee...</p><p>C</p><p></p></div></blockquote><p></p><p>is there any talk within Microsoft to have its own native programming language? I guess, kind of like Apple has Objective-C.&nbsp; A C like language with built in behavior that makes sure handles are closed and memory deallocated. Can call managed code, WinRT and COM.&nbsp; Easily handle ANSI and Unicode strings. Maybe I am describing C&#43;&#43;, but without all the stuff that makes the language hard for me to understand.</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/c7e7cec940b6474c9d49a04e011297cc#c7e7cec940b6474c9d49a04e011297cc</link>
		<pubDate>Fri, 11 May 2012 16:39:45 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/c7e7cec940b6474c9d49a04e011297cc#c7e7cec940b6474c9d49a04e011297cc</guid>
		<dc:creator>Steve Richter</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SteveRichter/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/c7e7cec940b6474c9d49a04e011297cc">12 minutes&nbsp;ago</a>, <a href="/Niners/SteveRichter">SteveRichter</a> wrote</p><p>*snip*</p><p>is there any talk within Microsoft to have its own native programming language?</p><p></p></div></blockquote><p></p><p>Not that I've seen. Most programmers are either happy using the C/C&#43;&#43;/ManagedC&#43;&#43; that they have, or have chosen to go for a managed language. I'm not sure adding a new native language to the mix would have any momentum at Microsoft or with developers.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/6872a9cc23c94245b167a04e0116b40b#6872a9cc23c94245b167a04e0116b40b</link>
		<pubDate>Fri, 11 May 2012 16:54:43 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/6872a9cc23c94245b167a04e0116b40b#6872a9cc23c94245b167a04e0116b40b</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>You can also just have modifiable classes like many dynamic languages have. That lets you do extension methods and a lot of other metaprogramming type things.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/e85323168a6f4e92aa74a04e01663847#e85323168a6f4e92aa74a04e01663847</link>
		<pubDate>Fri, 11 May 2012 21:44:14 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/e85323168a6f4e92aa74a04e01663847#e85323168a6f4e92aa74a04e01663847</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/C-needs-extension-methods/c7e7cec940b6474c9d49a04e011297cc">5 hours&nbsp;ago</a>, <a href="/Niners/SteveRichter">SteveRichter</a> wrote</p><p>A C like language with built in behavior that makes sure handles are closed and memory deallocated. Can call managed code, WinRT and COM.&nbsp; Easily handle ANSI and Unicode strings.</p><p></p></div></blockquote><p></p><p>Like C#:</p><p>* A C like language Check</p><p>* makes sure handles are closed and memory deallocated. Check.</p><p>* Can call managed code, Check</p><p>* WinRT Check</p><p>* and COM Check</p><p>*&nbsp;Easily handle ANSI and Unicode strings. Check.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/830173bbb32e414488dea04e0175a062#830173bbb32e414488dea04e0175a062</link>
		<pubDate>Fri, 11 May 2012 22:40:19 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/830173bbb32e414488dea04e0175a062#830173bbb32e414488dea04e0175a062</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>I think instead of spending resources on creating a whole new language, it might be more beneficial to spend those resources focusing on fixing&nbsp;areas of .Net/C# that cause people to want to use something else.</p><p>I imaging most of the time it is because .Net is too &quot;slow&quot;? IIRC, tests show&nbsp;it is within 10% of C&#43;&#43;'s performance. I'm sure in some areas it is significantly slower, like say when doing DSP. If you look at the IL of .Net code, it is already in a pretty optimized state but it really depends on how the JIT compiles it. I wonder how much performance can be gained by improving the JIT. Maybe have a AOT (ahead of time) compiler that is more agressive and does more optimizations etc.</p><p>Oh and much more aggressive method inlining...</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/ffe96dbe95b0426482faa04e017c8f88#ffe96dbe95b0426482faa04e017c8f88</link>
		<pubDate>Fri, 11 May 2012 23:05:34 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/ffe96dbe95b0426482faa04e017c8f88#ffe96dbe95b0426482faa04e017c8f88</guid>
		<dc:creator>BitFlipper</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/BitFlipper/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>C&#43;&#43; is the native language of choice at Microsoft (and C for low level kernel stuff).&nbsp;For Metro, we have a small C&#43;&#43; extension, C&#43;&#43;/CX. For GPGPU programming, we have a small C&#43;&#43; extension, C&#43;&#43; AMP.<br><br>C</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/f937a3fa9b5448b9a29ba04f017c5de2#f937a3fa9b5448b9a29ba04f017c5de2</link>
		<pubDate>Sat, 12 May 2012 23:04:52 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/f937a3fa9b5448b9a29ba04f017c5de2#f937a3fa9b5448b9a29ba04f017c5de2</guid>
		<dc:creator>Charles</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Charles/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - C++ needs extension methods</title>
		<description><![CDATA[<p>I don't see why open classes can't work for static/native languages by the way. Some people really think open classes it's a SUPAR BAD idea, but I never seen any argument on why.</p><p><br>(Open classes means you can &quot;reopen&quot; any class, eg std::string, and add features to it. Similar to BitFlipper's idea.)</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/46f42710cc1343f9b82fa04f017d7bba#46f42710cc1343f9b82fa04f017d7bba</link>
		<pubDate>Sat, 12 May 2012 23:08:56 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/C-needs-extension-methods/46f42710cc1343f9b82fa04f017d7bba#46f42710cc1343f9b82fa04f017d7bba</guid>
		<dc:creator>Bass</dc:creator>
		<slash:comments>48</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bass/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>