<?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>DateTime Compatibility Issue</title><link>http://blogs.msdn.com/brada/archive/2004/02/17/74914.aspx</link><description>The BCL team is having some design discussions on how to fix a bug that was recently found. I thought you might want to chime in as some of the implications have wide applicability. Here is the thread from Anthony &amp;#8230; comments welcome. I would like</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: DateTime Compatibility Issue</title><link>http://blogs.msdn.com/brada/archive/2004/02/17/74914.aspx#75002</link><pubDate>Tue, 17 Feb 2004 18:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:75002</guid><dc:creator>Chance Gillespie</dc:creator><description>I think if you break it down into a more fundamental meaning then the absolute wrong choice is completely obvious.&lt;br&gt;&lt;br&gt;What you are essentially asking is “Do we put up a canopy to protect the small amount of ill written code that would be affected by this at the cost of fracturing the framework and causing future code to shift gears to compensate, or do we keep future code as a priority”.&lt;br&gt;&lt;br&gt;To me at least, the answer is clear… Sacrifice the few for the benefit of the many. Making a change like freezing the enum and introducing a new one just to protect that small amount of code (which honestly should be dealing with the known enum values now and providing error handling for unknown values to future proof against breaking changes) would be far more harmful than beneficial. I don’t think many people would argue that option #1 is out of the question (please, PLEASE don’t let that happen, I beg you!!). If we get caught up in situations like this where we don’t take to heart the changes of the platform as a usable development tool we are going to end up right back where we were with Win32/COM: a big, disgusting, irritable, incomprehensible mess (I used to show pages of DirectX 3 code to kids on Halloween to send them screaming and crying in fear =) ).&lt;br&gt;&lt;br&gt;The choice between #2 and #3 are not as clear cut, however. I, myself, am firmly on the side of #2. If you leave things open, and just not bother with doing the checks then you have succeeded in sheltering those few from the breaking changes but you have also denied future code of a protection that you would expect from .NET (and WinFX in the future.. decisions like this can have a far greater impact on future decisions than you might first imagine).&lt;br&gt;&lt;br&gt;So it all boils down to a quantifiable choice. Protect the few at the cost of the many, or sacrifice the few for the benefit of the many. You mention that we (yeah, I feel a part of a community with .NET so I say we =) ) are already at the second revision of the platform with the 3rd on it’s way. Personally I think that v1.0 and v1.1 of the framework are so closely related that v.1.1 really should have been called v1.0.1. From what I have seen of v1.2 the changes are so massive that it is unquestionably deserving of the title v2.0. Generics alone give it that right (who knows, maybe Microsoft will give it that moniker in the end). Since I see the next release of the framework as the second real version, it pains me to think that we may end up setting a precedent by introducing these sorts of splintering changes into a young platform that has so much potential to learn from past mistakes and not take road into API decay.&lt;br&gt;&lt;br&gt;Then again, maybe I just need to drink another beer and relax =)&lt;br&gt;&lt;br&gt;Chance&lt;br&gt;&lt;br&gt;</description></item><item><title>re: DateTime Compatibility Issue</title><link>http://blogs.msdn.com/brada/archive/2004/02/17/74914.aspx#75039</link><pubDate>Tue, 17 Feb 2004 19:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:75039</guid><dc:creator>J. Daniel Smith</dc:creator><description>From reading the various MS blogs, there seems to be almost an undue emphasis on avoiding &amp;quot;breaking changes&amp;quot;.  I think that I pretty much agree is Chance Gillespie - do things the &amp;quot;right way&amp;quot;, even if that means some pain for a handful of people.&lt;br&gt;&lt;br&gt;And that &amp;quot;pain&amp;quot; is really only going to hurt in fairly isolated cases such as trying to run an old(er) version of an application on a new(er) version of the .NET framework.  Otherwise, what's the big deal?  We're doing a new release of our app, moving to a new release of Visual Studio, and we've got to change some code.  While that sucks, and it would be nice if we didn't have to change anything; it's not the end of the world.&lt;br&gt;&lt;br&gt;   Dan&lt;br&gt;</description></item><item><title>re: DateTime Compatibility Issue</title><link>http://blogs.msdn.com/brada/archive/2004/02/17/74914.aspx#75047</link><pubDate>Tue, 17 Feb 2004 20:07:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:75047</guid><dc:creator>Michael Teper</dc:creator><description>+1 on #2. Breaking change is OK when it breaks broken code.</description></item><item><title>re: DateTime Compatibility Issue</title><link>http://blogs.msdn.com/brada/archive/2004/02/17/74914.aspx#75072</link><pubDate>Tue, 17 Feb 2004 20:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:75072</guid><dc:creator>Tom McKearney</dc:creator><description>Absolutely #2.  I can't stand it when people use casting to get around things that were specifically designed to prevent them from entering the wrong value.</description></item><item><title>re: DateTime Compatibility Issue</title><link>http://blogs.msdn.com/brada/archive/2004/02/17/74914.aspx#75156</link><pubDate>Tue, 17 Feb 2004 23:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:75156</guid><dc:creator>Ben Maurer</dc:creator><description>I see no real reason to test for the values. If someone wants to pass junk to a function, just let them do that (unless it is a security risk). I can't think of any case where someone would be doing this other than just to probe the code.&lt;br&gt;&lt;br&gt;It would really sadden me to see enum checking become the de facto standard, which is basically what will happen if Microsoft goes this way. It is an issue that will never happen by mistake. You add no value to the API really by checking for the values.&lt;br&gt;&lt;br&gt;WRT versioning, I think that you should only mark the assembly as compat with a specific version of the fx if you can compile and run against it. This solves any issue with a function acting weirdly on an old version of the fx.</description></item><item><title>re: DateTime Compatibility Issue</title><link>http://blogs.msdn.com/brada/archive/2004/02/17/74914.aspx#75415</link><pubDate>Wed, 18 Feb 2004 10:28:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:75415</guid><dc:creator>Ian Ringrose</dc:creator><description>Make the “breaking” change in 1.2, as is may find a bug in software that I am writing.  At the same time, stop apps that are compiled against 1.1 from running with 1.2 ales the app.config file says they can.  Ship version 1.1 (and 1.0) of the framework with all Microsoft products (including server packs that have version 1.2 of the framework.  In other works make side by side running of the framework the normal case.&lt;br&gt;&lt;br&gt;What happens with the new SQL server, if there are two database in the same instance, and one database want versions 1.2 of the framework and other database wants version 1.3 of the framework?&lt;br&gt;</description></item><item><title>re: DateTime Compatibility Issue</title><link>http://blogs.msdn.com/brada/archive/2004/02/17/74914.aspx#76297</link><pubDate>Thu, 19 Feb 2004 14:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:76297</guid><dc:creator>Tom McKearney</dc:creator><description>            It is an issue that will never happen by mistake&lt;br&gt;&lt;br&gt;I don't agree.  If someone persists a structure or class with an Enum value in it to disk as a text file or XML or a database record and someone else goes and modifies the record manually, the resulting object will have an invalid value for an enumerator.  I want to know when that happens!  &lt;br&gt;&lt;br&gt;The whole point to an enumeration is to constrain data to a particular set of values.  If the language allows you to get around that, then every piece of code that reads and writes enums or accepts them as parameters has to manually bounds check them!  That's completely unacceptable.&lt;br&gt;&lt;br&gt;When you define an enumerated type as a parameter, that is a contract with the caller.  You shouldn't be able to pass anything you want.  As far as I'm concerned, in the right circumstances, this COULD be a security issue.&lt;br&gt;&lt;br&gt;Tom</description></item><item><title>Back in action</title><link>http://blogs.msdn.com/brada/archive/2004/02/17/74914.aspx#78108</link><pubDate>Mon, 23 Feb 2004 03:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:78108</guid><dc:creator>Mungo Knotwise of Michel Delving</dc:creator><description /></item><item><title>re: DateTime Compatibility Issue</title><link>http://blogs.msdn.com/brada/archive/2004/02/17/74914.aspx#78172</link><pubDate>Mon, 23 Feb 2004 05:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:78172</guid><dc:creator>Gavin Gregson</dc:creator><description>One more for #2. Passing illegal values to a function is an error and should be treated as such. Definitely don't do #1, that's a nasty slipperly slope.</description></item><item><title>Back in action</title><link>http://blogs.msdn.com/brada/archive/2004/02/17/74914.aspx#93237</link><pubDate>Sat, 20 Mar 2004 20:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:93237</guid><dc:creator>The Diffracted Developer @ Home</dc:creator><description /></item><item><title>.NET DateTime and Timezone: It Seems Simple, but It's Not</title><link>http://blogs.msdn.com/brada/archive/2004/02/17/74914.aspx#138889</link><pubDate>Sat, 22 May 2004 02:37:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:138889</guid><dc:creator>Mark Treadwell</dc:creator><description /></item><item><title>DateTime and Timezone</title><link>http://blogs.msdn.com/brada/archive/2004/02/17/74914.aspx#186088</link><pubDate>Sat, 17 Jul 2004 17:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:186088</guid><dc:creator>Ohad's WebLog</dc:creator><description /></item><item><title>C# Enum.Parse() Bug &amp;laquo; The Pursuit of a Life</title><link>http://blogs.msdn.com/brada/archive/2004/02/17/74914.aspx#6732323</link><pubDate>Tue, 11 Dec 2007 10:39:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6732323</guid><dc:creator>C# Enum.Parse() Bug « The Pursuit of a Life</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://xidey.wordpress.com/2007/12/10/c-enumparse-bug/"&gt;http://xidey.wordpress.com/2007/12/10/c-enumparse-bug/&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>