<?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>My dog has no type (Expressions with &amp;quot;Superposition&amp;quot; types)</title><link>http://blogs.msdn.com/lucian/archive/2008/11/05/my-dog-has-no-type.aspx</link><description>"My dog has no type." "How does he smell?" "Awful!" This article originally was called "Expressions with no types" but that was a misleading title. This article is really about expressions which have a "quantum superposition" of several types: that's</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Why all the typelessness?</title><link>http://blogs.msdn.com/lucian/archive/2008/11/05/my-dog-has-no-type.aspx#9048816</link><pubDate>Thu, 06 Nov 2008 16:10:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9048816</guid><dc:creator>Speednet</dc:creator><description>&lt;p&gt;I have a question for you regarding this huge push for &amp;quot;typelessness&amp;quot;.&lt;/p&gt;
&lt;p&gt;Why is getting rid of a declared type such an important thing for the Microsoft VB team these days?&lt;/p&gt;
&lt;p&gt;With .NET 2.0, the huge push was generics, which allowed very specific declaration of type at design time, which has the effect of making one's code crystal clear in intent, and further reduces bugs.&lt;/p&gt;
&lt;p&gt;(Naturally I am referring to code that utlilizes a generic collection, not the generic collection iteself.)&lt;/p&gt;
&lt;p&gt;Taking out all the types may make the compiler very smart, but for maintaing code it can be a nightmare. &amp;nbsp;Rather than simply reading and understanding the code and intent, one must go through an extra thought process to infer in one's mind what the compilation of the code will result in.&lt;/p&gt;
&lt;p&gt;I don't want to go back to the days of Variant, which is where all of this seems to be going, in one shape or another. &amp;nbsp;I like strongly typed code, for many reasons.&lt;/p&gt;
&lt;p&gt;You may say &amp;quot;all the support is still there, if that's what you want to do&amp;quot;, but that's not the answer. &amp;nbsp;By pushing typeless everywhere, the coding community will naturally try to follow your lead, and you know very well that bucking the trend is not healthy for the career of a developer.&lt;/p&gt;
</description></item><item><title>re: My dog has no type (Typeless Expressions)</title><link>http://blogs.msdn.com/lucian/archive/2008/11/05/my-dog-has-no-type.aspx#9049844</link><pubDate>Thu, 06 Nov 2008 19:59:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9049844</guid><dc:creator>ljw1004</dc:creator><description>&lt;p&gt;Thanks for the comment, Speednet.&lt;/p&gt;
&lt;p&gt;Here we're not going back to variant in any way shape or form. All the code here is strongly typed. Almost all the code in this article uses explicit type declarations (&amp;quot;Dim f2 as Func(Of String) = ...&amp;quot;). For the few lines that don't declare types explicitly, they still use type inference to infer (strong) types.&lt;/p&gt;
&lt;p&gt;We're not taking out types here. The article merely discusses how the compiler figures out the (strong) type of a fragment of an expression.&lt;/p&gt;
&lt;p&gt;Answer: in most cases, the (strong) type of a fragment of an expression is inevitable from that fragment alone. But in just four cases, the (strong) type of a fragment of an expression is determined by the context.&lt;/p&gt;
&lt;p&gt;We needed these four cases because otherwise it would have been awful. Imagine if you had to use not just one flexibly-typed constant &amp;quot;Nothing&amp;quot;, but instead a whole family of uniquely typed called &amp;quot;DateNothing&amp;quot; and &amp;quot;IntegerNothing&amp;quot; and so on.&lt;/p&gt;
&lt;p&gt;Question: does weak typing (i.e. Option Strict Off in VB, or the &amp;quot;dynamic&amp;quot; type in C#) have a role? Answer: yes, a limited one, for interop with weakly typed systems like Python and Javascript and HTML DOM, and to some extent with Office COM.&lt;/p&gt;
&lt;p&gt;Question: given that we're strongly-typed, does type inference have a role? ...&lt;/p&gt;
</description></item></channel></rss>