The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Q: Compiler compatibility vs. comformance

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Eric Gunnerson

Posts: 1006
Nickname: ericgu
Registered: Aug, 2003

Eric Gunnerson is a program manager on the Visual C# team
Q: Compiler compatibility vs. comformance Posted: Oct 10, 2003 4:16 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Eric Gunnerson.
Original Post: Q: Compiler compatibility vs. comformance
Feed Title: Eric Gunnerson's C# Compendium
Feed URL: /msdnerror.htm?aspxerrorpath=/ericgu/Rss.aspx
Feed Description: Eric comments on C#, programming and dotnet in general, and the aerodynamic characteristics of the red-nosed flying squirrel of the Lesser Antilles
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Eric Gunnerson
Latest Posts From Eric Gunnerson's C# Compendium

Advertisement

I got an email from a customer today, in which he noted that the C# compiler allows you to write:

bool b = ...

switch (b)
{
    case true:
        ...
        break;

    case false:
        ....
        break;
}

despite the fact that the spec does not list bool as one of the types that you can switch on.

Unfortunately, we've shipped the current behavior, and one of our high-order goals is not to break existing code by changing the compiler. In most cases, that's a really good goal, as your customers are justifiably upset when the new compiler breaks their code.

In this case, however, I think we may be going to far in not fixing a bug because there's a chance somebody might have written code that used it. I'm therefore looking for your opinion (noting, for the record, that it seems that I could sometimes be replaced by an auto-blogger question-asking piece of software) on what makes the most sense.

Question:

How would you have us trade off language conformance (and perhaps language innovation) vs language stability?

More specifically, when is it acceptable for the compiler to give an error on code that used to work?

 

Read: Q: Compiler compatibility vs. comformance

Topic: My Own Cache Previous Topic   Next Topic Topic: .NET Nightly 24

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use