<?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>SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx</link><description>Development has currently come to a complete halt for me. This is partly due to the fact that i'm a lazy bum, and i'd rather loaf around than earn my keep. However, beyond that we're currently meeting with our C# Customer Council conducting an Strategic</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#409711</link><pubDate>Tue, 19 Apr 2005 20:20:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:409711</guid><dc:creator>Nicholas Paldino [.NET/C# MVP]</dc:creator><description>Come say hi when you have a chance...</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#409731</link><pubDate>Tue, 19 Apr 2005 20:57:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:409731</guid><dc:creator>Mark Michaelis</dc:creator><description>We didn't say, 'Don't do edit-&amp;amp;-continue.'  We said, 'Don't prioritize it above refactoring support like rename.'  The team did them both.... Excellent!  :)</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#409736</link><pubDate>Tue, 19 Apr 2005 21:06:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:409736</guid><dc:creator>CyrusN</dc:creator><description>Mark: You're absolutely correct, and i should have been more clear.   i'll edit the above to state that.</description></item><item><title>You want feedback, you got it ;)</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#409791</link><pubDate>Tue, 19 Apr 2005 23:31:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:409791</guid><dc:creator>Stuart Ballard</dc:creator><description>I'm going to say again &amp;quot;Please make nullable types sane&amp;quot;!&lt;br&gt;&lt;br&gt;When I filed bugs in the feedback center I got back responses that were so far removed from reality as I see it that for a long time I just decided to ignore the issue because there was no way that the developers were going to see my point of view. But I recently realized that I'd never bothered to actually explain my credentials and why I feel that I have some credibility when it comes to talking about nullable types.&lt;br&gt;&lt;br&gt;You see, one of the very first things I did in C#, about three years ago I think (I haven't checked the date in my source control history yet) was produce nullable versions of int, bool, DateTime, long, short, etc etc for a DAL layer I was working on. Since then those types have been in daily use by every developer in my company (a team of 4-5 people over the course of those years). I've had to explain the behavior of my nullable types to those developers, fix things they found confusing, and try to explain the problems that cannot be fixed without help from the language.&lt;br&gt;&lt;br&gt;When I say &amp;quot;people will find this behavior confusing&amp;quot;, it's because I've given types with that behavior to developers and *watched* them be confused by it. Or had to fix the same bug once every few months because the behavior is so counterintuitive that even after having it explained and grasping the problem, they'll still make the same mistake a few months later.&lt;br&gt;&lt;br&gt;So I believe I ought to have some level of credibility when I say that the nullable types in C# 2.0 are significantly worse than what could be implemented three years ago without any help from the language.&lt;br&gt;&lt;br&gt;And having had this realization that actually I should have some credibility, I've decided to do what I can to fight for a less confusing behavior, including giving feedback in every forum I can find. I intend to go back and revisit my (closed By Design) bugs in the feedback center to comment to this effect, and also leave comments like this when I see C#-related people asking for feedback.&lt;br&gt;&lt;br&gt;The current behavior of nullable types WILL be a huge source of pain to developers, myself and my team in particular but also anyone else who uses them. Please, I know it's late in the game, but please consider revisiting this design! If you don't fix it now, you NEVER can.&lt;br&gt;&lt;br&gt;If you're not sure what my issues actually are, here are the biggest:&lt;br&gt;&lt;br&gt;(int) (object) (int?) 1;&lt;br&gt;(int?) (object) 1;&lt;br&gt;int? i = condition ? 1 : null;&lt;br&gt;if ((object) (int?) null != null) print(&amp;quot;WRONG&amp;quot;);&lt;br&gt;&lt;br&gt;The first three of these are real sources of pain with my current nullable types. The fourth one is handled correctly in my wrappers but I KNOW that it would be causing bugs all the time if it weren't.&lt;br&gt;&lt;br&gt;Also, methods and interfaces on the underlying types really should be lifted onto the nullable type. This also caused lots of complaints until I implemented it on my wrappers. Who wants nullable types that can't be sorted or formatted right?</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#409795</link><pubDate>Tue, 19 Apr 2005 23:41:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:409795</guid><dc:creator>CyrusN</dc:creator><description>Stuart: I absolutely understand where you are coming from, and i've forwarded your comments in full to the rest of the language design team.&lt;br&gt;&lt;br&gt;I really hope we can make things better here.</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#409958</link><pubDate>Wed, 20 Apr 2005 10:12:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:409958</guid><dc:creator>Adel</dc:creator><description>You are right , you should focus on developing tools that will make developer’s life easier. Directory services developers lack tools that deal with group policy objects of active directory. I I really appreciate it if you point to exiting tool that does that function.&lt;br&gt;&lt;br&gt;Adel&lt;br&gt;&lt;br&gt;email:adel.husain@aramco.com&lt;br&gt;&lt;br&gt;Saudi araibia.</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#410011</link><pubDate>Wed, 20 Apr 2005 14:55:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:410011</guid><dc:creator>DrPizza</dc:creator><description>&amp;quot;Instead, they get the most benefit from the high level APIs that that implementing that domain specific logic far easier&amp;quot;&lt;br&gt;Related to this, an oldie (but a goodie!).&lt;br&gt;&lt;br&gt;Using C# is immensely painful because the runtime doesn't have a decent set of container classes.  This issue has repercussions in C# itself (because C# &amp;quot;knows&amp;quot; about certain bits of the runtime, like String, and iteration), and has even broader repercussions at the higher API level.  Not only does C# not have a quality set of containers, but the runtime forces higher level APIs to make the same bad design decisions, thanks to the poor design of e.g. IList.&lt;br&gt;&lt;br&gt;C# lacks good parallel programming support.  The async model in Cw may be useful, but I'd be more interested in something closer to OpenMP directives.&lt;br&gt;&lt;br&gt;When one is doing pinvoke programming and one wishes to marshal structures to and from buffers, I want more control over how I can define the layout of the buffer.  (To be honest, I've not much looked at .netfx 2, so perhaps these things are fixed).  In particular, I want a way to specify that an array's size is determined by another member of the class.  In other words, you need to make SizeParamIndex non-retarded (currently, amongst other failings, it works only on parameters).</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#410168</link><pubDate>Wed, 20 Apr 2005 21:58:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:410168</guid><dc:creator>CyrusN</dc:creator><description>DrPizza: &amp;quot;Using C# is immensely painful because the runtime doesn't have a decent set of container classes. &amp;quot;&lt;br&gt;&lt;br&gt;Well, you already know what my answer is going to be on this :)&lt;br&gt;&lt;br&gt;The fact that you mentioned the word &amp;quot;set&amp;quot; in your sentence is especially humorous to me.</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#410171</link><pubDate>Wed, 20 Apr 2005 22:09:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:410171</guid><dc:creator>Stuart Ballard</dc:creator><description>FWIW, I blogged a longer writeup of my issues with nullable types here:&lt;br&gt;&lt;br&gt;&lt;a rel="nofollow" target="_new" href="http://sab39.dev.netreach.com/Blog/12?vobId=172&amp;amp;pm=18"&gt;http://sab39.dev.netreach.com/Blog/12?vobId=172&amp;amp;pm=18&lt;/a&gt;</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#410177</link><pubDate>Wed, 20 Apr 2005 22:51:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:410177</guid><dc:creator>CyrusN</dc:creator><description>Stuart: Thanks very much for that writeup.  It has been forwarded as well, and will be discussed. &lt;br&gt;&lt;br&gt;I really appreciate you going through this time to express your frustration.  It's far easier to make certain arguments when you can point to customers and clearly understand the problem they're having.</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#410191</link><pubDate>Wed, 20 Apr 2005 23:34:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:410191</guid><dc:creator>Stuart Ballard</dc:creator><description>Cyrus, I can't thank you enough for taking the time to forward my concerns and taking them seriously enough to get them considered.&lt;br&gt;&lt;br&gt;I imagine that since it's so late in the game, the chances of getting any really big changes made are slim (I'd LOVE to be wrong of course!). With that in mind, at least one of the problems can be fixed with virtually no downside: &amp;quot;test() ? 1 : null&amp;quot; is currently illegal code so there's no chance of breaking working code by fixing it.</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#410209</link><pubDate>Thu, 21 Apr 2005 00:14:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:410209</guid><dc:creator>CyrusN</dc:creator><description>Stuart: I can't promise anything.  However, i can tell you that this is beign taken very seriously.</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#410250</link><pubDate>Thu, 21 Apr 2005 02:40:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:410250</guid><dc:creator>DrPizza</dc:creator><description>&amp;quot;The fact that you mentioned the word &amp;quot;set&amp;quot; in your sentence is especially humorous to me. &amp;quot;&lt;br&gt;:D&lt;br&gt;&lt;br&gt;But seriously, if that single attribute were changed to be made more general it would make my life SO much easier.&lt;br&gt;&lt;br&gt;I mean, it might actually make it practical to call many of the more interesting Win32 APIs from C#!</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#410263</link><pubDate>Thu, 21 Apr 2005 03:00:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:410263</guid><dc:creator>DrPizza</dc:creator><description>And it looks to me like nullable types are bullshit.&lt;br&gt;&lt;br&gt;They seem to me to be a workaround to an issue that other languages (e.g. Java, C++) don't have, because those languages let one create any type on the heap (or at least, close enough to &amp;quot;any type&amp;quot;, in the case of Java's primitive wrappers).&lt;br&gt;&lt;br&gt;This provides nullability for &amp;quot;value&amp;quot; types and &amp;quot;reference&amp;quot; types alike (either by effectively having no value types, as in Java, or by effectively having no reference types, as in C++).&lt;br&gt;&lt;br&gt;The &amp;quot;nullable types&amp;quot; approach chosen by C# introduces new semantics that differ significantly from those of plain ol' reference types.  Yet those reference type semantics are IMNSHO the ones we really want for nullable types; they're certainly the ones we want when communicating with databases and so on (of course, databases shouldn't have nullable columns anyway, so the issue shouldn't really arise often in any case).  The difference in the semantics seems frankly inexplicable.&lt;br&gt;&lt;br&gt;What nullable types SHOULD have been used for is to make NullReferenceExceptions rarer.  The normal reference declaration &amp;quot;Type name;&amp;quot; should create a variable or field that *cannot* be null.  If you need for some reason a reference that may not refer to anything, then *that* is what a &amp;quot;nullable type&amp;quot; should be used for.  In this regard, C#'s references should be much more like C++'s references (which equally aren't nullable).  Converting from a nullable reference to a non-nullable reference should require an explicit (and checked, throwing a NullReferenceException if it fails) cast.</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#410490</link><pubDate>Thu, 21 Apr 2005 20:05:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:410490</guid><dc:creator>Stuart Ballard</dc:creator><description>DrPizza: I agree with you that it would be really cool to have a construct for *NON*-nullable values of reference types as well as for nullable values of value types. I feel that that's much less urgent at this point because there's no construct being introduced in 2.0 that would prevent adding that behavior in the future.&lt;br&gt;&lt;br&gt;On the other hand, if the current design of C# 2.0 stands, there's no way to get sane nullable value types at any point in the future ever.&lt;br&gt;&lt;br&gt;(Just because, here's a suggested syntax for non-nullable reference types:&lt;br&gt;&lt;br&gt;string s1 = null;&lt;br&gt;string! s2 = &amp;quot;hello&amp;quot;;&lt;br&gt;string! s3 = null; // compiler error&lt;br&gt;&lt;br&gt;I like the idea of the parallel between &amp;quot;int?&amp;quot; as a nullable integer and &amp;quot;string!&amp;quot; as a non-nullable string. However, I'm not 100% sure that this wouldn't result in any syntax ambiguities...)</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#410514</link><pubDate>Thu, 21 Apr 2005 21:28:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:410514</guid><dc:creator>CyrusN</dc:creator><description>Stuart: Non-null reference types is another thing in the list of features that we are always thinking about.  And yes, we would probably go with the ! syntax mentioend above.&lt;br&gt;&lt;br&gt;It would have been cleaner for:&lt;br&gt;&lt;br&gt;Foo&lt;br&gt;&lt;br&gt;to always mean &amp;quot;non null Foo&amp;quot; regardless of it was a value type or reference type, and then just have:&lt;br&gt;&lt;br&gt;Foo?&lt;br&gt;&lt;br&gt;mean &amp;quot;possible null Foo&amp;quot; for eitehr value or reference.&amp;quot;&lt;br&gt;&lt;br&gt;But, at this point, we could never make that change to the langauge given the enormous amount of code out there that this woudl then break.</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#410518</link><pubDate>Thu, 21 Apr 2005 21:40:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:410518</guid><dc:creator>Stuart Ballard</dc:creator><description>Non-null ref types are interesting.&lt;br&gt;&lt;br&gt;For example,&lt;br&gt;&lt;br&gt;class Foo {&lt;br&gt;  string! x;&lt;br&gt;}&lt;br&gt;&lt;br&gt;would have to be illegal, because there's no legitimate initial value for the variable (unless string is somehow made special so that the default can be &amp;quot;&amp;quot;, or the default is just to call a no-arg ctor if there is one, which both have their own issues).&lt;br&gt;&lt;br&gt;Presumably &amp;quot;x is string!&amp;quot; would be equivalent to &amp;quot;x != null &amp;amp;&amp;amp; x is string&amp;quot;... actually I'm not sure what &amp;quot;is&amp;quot; does with null today so that may be redundant.&lt;br&gt;&lt;br&gt;Another interesting consequence is that the recommended pattern of using &amp;quot;as&amp;quot; to avoid the double-check implicit in an &amp;quot;is&amp;quot; followed by a cast, doesn't work. In fact, a non-nullable type can't appear on the right hand side of &amp;quot;as&amp;quot; at all, just like value types.&lt;br&gt;&lt;br&gt;string x;&lt;br&gt;if (x != null) {&lt;br&gt;  string! y = (string!) x;&lt;br&gt;}&lt;br&gt;&lt;br&gt;Doesn't look like there's an easy way to avoid the double-null-check there. Still, a null check is much quicker than a type check, so it's probably not a big deal.&lt;br&gt;&lt;br&gt;All of this stuff hints that non-nullable types probably can't be implemented with just a NonNullable&amp;lt;T&amp;gt; struct in the framework. At the very least, if you try to do it that way, you'll hit most of the same issues as Nullable&amp;lt;T&amp;gt; hits today, and a bunch of interesting new ones ;)</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#410752</link><pubDate>Fri, 22 Apr 2005 14:29:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:410752</guid><dc:creator>DrPizza</dc:creator><description>&amp;quot;It would have been cleaner for: &lt;br&gt;&lt;br&gt;Foo &lt;br&gt;&lt;br&gt;to always mean &amp;quot;non null Foo&amp;quot; regardless of it was a value type or reference type, and then just have: &lt;br&gt;&lt;br&gt;Foo? &lt;br&gt;&lt;br&gt;mean &amp;quot;possible null Foo&amp;quot; for eitehr value or reference.&amp;quot; &amp;quot;&lt;br&gt;Yes, precisely.  That's what you should do.  &lt;br&gt;&lt;br&gt;&amp;quot;But, at this point, we could never make that change to the langauge given the enormous amount of code out there that this woudl then break. &amp;quot;&lt;br&gt;Balls.&lt;br&gt;&lt;br&gt;Providing a translation tool would be relatively easy and would fix most issues (turn uninitialized references to nullable ones, leave initialized ones alone).&lt;br&gt;&lt;br&gt;And providing a mechanism to compile using the rules of an older version of the language would also be easy to do, and solve all the issues for those unwilling to upgrade.  It's the approach Java has used for a long time now, and it works well.&lt;br&gt;&lt;br&gt;Frankly, I don't understand where this mindset that you can't break any code has come from.  It's done under the misguided impression that it's somehow better for the users, but what it actually means is that we're left with a language with less consistency and more peculiarities to work around.  There may be some small short-term win, but there's certainly a long-term loss.  And it's probably not best for you guys either; working around e.g. a failure to reserve an identifier that you later want to use as a keyword by using context-sensitive keywords and adding yet more constructs to the language makes your job harder too.&lt;br&gt;&lt;br&gt;What's all the more confounding is that neither of C#'s real competitors (VB/VB.NET, Java) have anything like the same aversion to breaking changes, in spite of having at least an order of magnitude more code written in them than C#.  VB traditionally hasn't even provided any kind of mechanism to ease the upgrade path (the VB6 to VB.NET converter being something of an anomaly in this regard), yet has never been hurt because of this.</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#410754</link><pubDate>Fri, 22 Apr 2005 14:37:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:410754</guid><dc:creator>DrPizza</dc:creator><description>&amp;quot;class Foo { &lt;br&gt;string! x; &lt;br&gt;} &lt;br&gt;&lt;br&gt;would have to be illegal, because there's no legitimate initial value for the variable (unless string is somehow made special so that the default can be &amp;quot;&amp;quot;, or the default is just to call a no-arg ctor if there is one, which both have their own issues). &amp;quot;&lt;br&gt;Fair enough.  Make it illegal.  It's illegal in C++ (whose references aren't nullable), so it's not the end of the world.  In C++ reference members must be initialized in the init list of constructor(s), viz:&lt;br&gt;&lt;br&gt;struct X&lt;br&gt;{&lt;br&gt;	int&amp;amp; i;&lt;br&gt;	X(int&amp;amp; i_) : i(i_)&lt;br&gt;	{&lt;br&gt;	}&lt;br&gt;};&lt;br&gt;&lt;br&gt;C#'s references will, unlike C++'s, remain rebindable.  Which brings me on to another issue; the ability to overload == should be removed because it doesn't work at all nicely.  It's fine in C++ (for obvious reasons).  It's craptastic in C#.  Either remove it, or introduce unambiguous syntax for reference and value equality.  e.g. == for value equality only (a compile-time error to try to use it for comparisons between value types or nulls/nullable types), === for reference equality.</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#411176</link><pubDate>Sat, 23 Apr 2005 21:50:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:411176</guid><dc:creator>Cyrus Najmabadi</dc:creator><description>Stuart: &amp;quot;Non-null ref types are interesting.&amp;quot;&lt;br&gt;&lt;br&gt;Yup.  i'm about to blog about this, but i'm going to go through your post first.&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;quot;For example,&lt;br&gt;&lt;br&gt;class Foo {&lt;br&gt;....string! x;&lt;br&gt;}&lt;br&gt;&lt;br&gt;would have to be illegal, because there's no legitimate initial value for the variable (unless string is somehow made special so that the default can be &amp;quot;&amp;quot;, or the default is just to call a no-arg ctor if there is one, which both have their own issues).&amp;quot;&lt;br&gt;&lt;br&gt;It actually is possible, however there are other issues to be taken care of.  I'll address this in my post.&lt;br&gt;&lt;br&gt;&amp;quot;Presumably &amp;quot;x is string!&amp;quot; would be equivalent to &amp;quot;x != null &amp;amp;&amp;amp; x is string&amp;quot;... actually I'm not sure what &amp;quot;is&amp;quot; does with null today so that may be redundant.&amp;quot;&lt;br&gt;&lt;br&gt;today, &amp;quot;null&amp;quot; is not anything.  so the semantics would stay the same.   This is different from java where &amp;quot;null&amp;quot; is anything.&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;quot;Another interesting consequence is that the recommended pattern of using &amp;quot;as&amp;quot; to avoid the double-check implicit in an &amp;quot;is&amp;quot; followed by a cast, doesn't work. In fact, a non-nullable type can't appear on the right hand side of &amp;quot;as&amp;quot; at all, just like value types.&lt;br&gt;&lt;br&gt;string x;&lt;br&gt;if (x != null) {&lt;br&gt;....string! y = (string!) x;&lt;br&gt;}&amp;quot;&lt;br&gt;&lt;br&gt;it's quite possible we could optimize this out, or provide a language construct to do the same.  however, null checks are exceedingly cheap (something like 1 instruction, so it's not clear that it's necessary since the CPU is going to do a completely acceptable job here&lt;br&gt;&lt;br&gt;&amp;quot;Doesn't look like there's an easy way to avoid the double-null-check there. Still, a null check is much quicker than a type check, so it's probably not a big deal.&lt;br&gt;&lt;br&gt;All of this stuff hints that non-nullable types probably can't be implemented with just a NonNullable&amp;lt;T&amp;gt; struct in the framework. At the very least, if you try to do it that way, you'll hit most of the same issues as Nullable&amp;lt;T&amp;gt; hits today, and a bunch of interesting new ones ;)&amp;quot;&lt;br&gt;&lt;br&gt;struct NonNullable&amp;lt;T&amp;gt; where T : class&lt;br&gt;&lt;br&gt;would be quite *un*-ideal (for many of the same reasons that Nullable&amp;lt;T&amp;gt; is un-ideal.  For example, you would have to have a public no-arg constructor that would, by default initialize the internal T field to null.  Whoops!  Right off the bat you're allowing a null T when the point was to not allow one.</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#411177</link><pubDate>Sat, 23 Apr 2005 22:00:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:411177</guid><dc:creator>Cyrus Najmabadi</dc:creator><description>DrPizza: I'll probably do a post on backwards compatibility later, but i'll address your points here first.&lt;br&gt;&lt;br&gt;&amp;quot;Balls.&amp;quot;&lt;br&gt;&lt;br&gt;To you maybe.  However, there are a hell of a lot of other customers who don't feel the same way.  And We have to strike a balance here.&lt;br&gt;&lt;br&gt;&amp;quot;Providing a translation tool would be relatively easy and would fix most issues (turn uninitialized references to nullable ones, leave initialized ones alone).&amp;quot;&lt;br&gt;&lt;br&gt;And what translates all the source code examples out there?  What goes and translates the thousands of books already written and on the shelf?  What goes through and reeducates the millions of programmers and lets them know that the old way they thought of the language is no longer valid?  There is benefit in not changing the language already shipped and instead just adding new things to it that can then be learned independently.  &lt;br&gt;&lt;br&gt;Say, for sake of example, we did go down your path and provided these tools to change all your source code.  Now, during the course of a person's work they run across a bit of code that just says something like:&lt;br&gt;&lt;br&gt;string s;&lt;br&gt;&lt;br&gt;They now have to ask tehmselves &amp;quot;ok... is this pre C# 3.0 code or post C# 3.0 code.   Does that mean non-nullable string, or nullable string... &amp;quot;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;quot;And providing a mechanism to compile using the rules of an older version of the language would also be easy to do, and solve all the issues for those unwilling to upgrade. It's the approach Java has used for a long time now, and it works well.&amp;quot;&lt;br&gt;&lt;br&gt;AFAIK, java has only provided that for asserts and enums, not changing one of the fundamental ways that types are represented in source.&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;quot;Frankly, I don't understand where this mindset that you can't break any code has come from. It's done under the misguided impression that it's somehow better for the users, but what it actually means is that we're left with a language with less consistency and more peculiarities to work around. There may be some small short-term win, but there's certainly a long-term loss. And it's probably not best for you guys either; working around e.g. a failure to reserve an identifier that you later want to use as a keyword by using context-sensitive keywords and adding yet more constructs to the language makes your job harder too.&amp;quot;&lt;br&gt;&lt;br&gt;Then you should talk to more customers.  Retraining is massively expensive to them, and as they will be interfacing with otehr customers (who may or may not be using the new C#) it has the potential for *enormous* confusion.  &lt;br&gt;&lt;br&gt;&amp;quot;What's all the more confounding is that neither of C#'s real competitors (VB/VB.NET, Java) have anything like the same aversion to breaking changes, in spite of having at least an order of magnitude more code written in them than C#. VB traditionally hasn't even provided any kind of mechanism to ease the upgrade path (the VB6 to VB.NET converter being something of an anomaly in this regard), yet has never been hurt because of this.&amp;quot;&lt;br&gt;&lt;br&gt;VB has been massively hurt because of not keeping backwards compat.  It's basically the #1 issue that their customers are upset about.  We'd rather not go down that path since we've seen how unhappy people are about it.&lt;br&gt;&lt;br&gt;Sure it does make the language not as nice as possible.  That's definitely a shame.  But I'm ok with having some cruft if it means that our customers can adopt and use the language (especially the large numbers of whom need to use C# 1.0 and 2.0 at the same time).</description></item><item><title>re: SDR Time</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#411333</link><pubDate>Sun, 24 Apr 2005 06:45:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:411333</guid><dc:creator>Stuart Ballard</dc:creator><description>class Foo {&lt;br&gt;  string! x = y;&lt;br&gt;  string! y = x;&lt;br&gt;}&lt;br&gt;&lt;br&gt;How's that for an evil case? I don't know what your proposed solution is, but that's something it'll need to handle, since it's permitted for regular strings (personally, if I'd been designing the language, I'd have been inclined to have initializer dependencies detected and disallowed circularities, but that's water under the bridge now).&lt;br&gt;&lt;br&gt;Or how about:&lt;br&gt;&lt;br&gt;class Foo {&lt;br&gt;  public static string! x = Bar.x + &amp;quot; World&amp;quot;;&lt;br&gt;}&lt;br&gt;class Bar {&lt;br&gt;  public static string! x = Foo.x + &amp;quot; Hello&amp;quot;;&lt;br&gt;}&lt;br&gt;&lt;br&gt;With regular strings, I think you get non-deterministic behavior there depending on whether Foo or Bar gets referenced first. But what happens with string!s?&lt;br&gt;&lt;br&gt;FWIW, I completely 100% agree with you about not breaking existing code (which is one of the reasons I feel so strongly we need to fix nullable types NOW, rather than as a breaking change in 3.0). I have other things I'd like to see in C# also (covariant return types; co/contravariant generics; a construct like x?.y that's equivalent to &amp;quot;x == null ? null : x.y&amp;quot;; Foo&amp;lt;T&amp;gt; where T : enum; the ability to define other members of an enum type (like Java permits); an automatic Parse(string) method on every enum type; etc) but all these can be added later without breaking existing code (and when the time comes to start designing C# 3.0 I'll be right there giving feedback for it). But right now I'm just going to push the nullable type issue as hard as I can, if only I can find where the buttons are :)</description></item><item><title>Non-nullable types</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#411618</link><pubDate>Mon, 25 Apr 2005 10:05:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:411618</guid><dc:creator>Cyrus' Blather</dc:creator><description>For those of you who don't read the comments made on other posts of&lt;br&gt;mine, you might be unaware about...</description></item><item><title> Cyrus Blather SDR Time | Paid Surveys</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#9658825</link><pubDate>Sat, 30 May 2009 00:46:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9658825</guid><dc:creator> Cyrus Blather SDR Time | Paid Surveys</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://paidsurveyshub.info/story.php?title=cyrus-blather-sdr-time"&gt;http://paidsurveyshub.info/story.php?title=cyrus-blather-sdr-time&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> Cyrus Blather SDR Time | Wood TV Stand</title><link>http://blogs.msdn.com/cyrusn/archive/2005/04/19/409708.aspx#9671526</link><pubDate>Mon, 01 Jun 2009 00:56:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9671526</guid><dc:creator> Cyrus Blather SDR Time | Wood TV Stand</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://woodtvstand.info/story.php?id=11536"&gt;http://woodtvstand.info/story.php?id=11536&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>