<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Anders Hejlsberg Introduces C# 4.0 at PDC 2008</title><link>http://blogs.msdn.com/ericwhite/archive/2008/10/29/anders-hejlsberg-introduces-c-4-0-at-pdc-2008.aspx</link><description>[Blog Map] Anders Hejlsberg presented a fascinating and entertaining session at PDC 2008 on C# 4.0 . He talked about dynamic typing, optional and named parameters, improved COM interoperability, and improved support for co-variance and contra-variance.</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>the rasx() context  &amp;raquo; Blog Archive   &amp;raquo; PDC 2008 Links</title><link>http://blogs.msdn.com/ericwhite/archive/2008/10/29/anders-hejlsberg-introduces-c-4-0-at-pdc-2008.aspx#9040204</link><pubDate>Tue, 04 Nov 2008 19:37:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9040204</guid><dc:creator>the rasx() context  &amp;raquo; Blog Archive   &amp;raquo; PDC 2008 Links</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://kintespace.com/rasxlog/?p=1210"&gt;http://kintespace.com/rasxlog/?p=1210&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Anders Hejlsberg Introduces C# 4.0 at PDC 2008</title><link>http://blogs.msdn.com/ericwhite/archive/2008/10/29/anders-hejlsberg-introduces-c-4-0-at-pdc-2008.aspx#9190755</link><pubDate>Wed, 10 Dec 2008 15:21:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9190755</guid><dc:creator>on the code sample</dc:creator><description>&lt;p&gt;why not use an interface instead of a the &amp;quot;dynamic&amp;quot; type?&lt;/p&gt;
</description></item><item><title>re: Anders Hejlsberg Introduces C# 4.0 at PDC 2008</title><link>http://blogs.msdn.com/ericwhite/archive/2008/10/29/anders-hejlsberg-introduces-c-4-0-at-pdc-2008.aspx#9190757</link><pubDate>Wed, 10 Dec 2008 15:22:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9190757</guid><dc:creator>hmm</dc:creator><description>&lt;p&gt;is this considered duck typing? &amp;nbsp;is there situation outside of COM+ where this is useful?&lt;/p&gt;
</description></item><item><title>re: Anders Hejlsberg Introduces C# 4.0 at PDC 2008</title><link>http://blogs.msdn.com/ericwhite/archive/2008/10/29/anders-hejlsberg-introduces-c-4-0-at-pdc-2008.aspx#9467780</link><pubDate>Mon, 09 Mar 2009 17:08:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9467780</guid><dc:creator>Aleksei</dc:creator><description>&lt;p&gt;&amp;gt;&amp;gt;why not use an interface instead of a the &amp;quot;dynamic&amp;quot; type?&lt;/p&gt;
&lt;p&gt;Because its easier to write &amp;quot;dynamic&amp;quot;, then to implement several interfaces.&lt;/p&gt;
</description></item><item><title>re: Anders Hejlsberg Introduces C# 4.0 at PDC 2008</title><link>http://blogs.msdn.com/ericwhite/archive/2008/10/29/anders-hejlsberg-introduces-c-4-0-at-pdc-2008.aspx#9570885</link><pubDate>Mon, 27 Apr 2009 16:18:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9570885</guid><dc:creator>Nik</dc:creator><description>&lt;p&gt;&amp;quot;&amp;gt;&amp;gt;why not use an interface instead of a the &amp;quot;dynamic&amp;quot; type?&lt;/p&gt;
&lt;p&gt;Because its easier to write &amp;quot;dynamic&amp;quot;, then to implement several interfaces.&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;The answer runs deeper than that. Imagine you are working on a large enterprise scale project that utilizes a number of third party libraries. Say you have a LibA.dll and LibB.dll. Both these libraries provide charting capabilities. Say LibA has class ClassA and Lib.dll has class ClassB. Depending on the kind of chart you are displaying (bar or pie) your method to render chart takes either LibA.ClassA or LibB.ClassB and calls the .Draw method.&lt;/p&gt;
&lt;p&gt;With dynamics you can do like this&lt;/p&gt;
&lt;p&gt;void RenderChart(dynamics x)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;x.Draw();&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Yes the example I have taken can possibly be solved with Generics. But this is just intended to point out that there are conditions that require &amp;quot;duck typing&amp;quot;. Basically this is useful in all those situations where members of different types have a common set of members amongst their implemented interfaces even if they don't implement a single common interface.&lt;/p&gt;
</description></item></channel></rss>