Recently, I’ve watched some videos about C# async bugs and got into discussions with friends.
Is it correct to say that a programming language has a bug ?
or can you only say that a compiler has a bug ?
what is the difference between both ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The language has a design flaw if it’s not designed well for whatever reason (e.g. the ability to call static methods via an expression of the declaring type in Java, IMO).
The language has a bug (IMO) if the specification is contradictory or doesn’t express what the author intended it to express. (I believe there are some bugs in the C# language specification around type inference, for example.)
The compiler has a bug if it fails to implement the specification correctly.
EDIT: I’ve found an example of a spec bug which is rather simpler than type inference ones…
In the C# 4 spec, section 7.3.1 states: “Except for the assignment operators, all binary operators are left-associative”.
Section 7.13 states: “The null coalescing operator is right-associative”
As the null coalescing operator is a non-assignment binary operator, this is a contradiction and thus (IMO) a bug. (It was also noted in this Stack Overflow question.)
The null coalescing operator also provides an example of a compiler bug which I discovered while answering that question…