For those who misread the question: let’s pretend we’re on Wikipedia.
I’m not looking for “the right way”, I’m looking for verifiable references to support either side.
(Please read to the end)
The Context
In a comment on a different thread, a person said his friends would beg to differ with my opinion on whether
if (!condition)
or
if (condition == false)
is preferred in C#.
As much as I was sure I know how to do the Right Thing™, I was unable to find any evidence my opinion is official in neither C# coding nor design guidelines.
The Question
Is there anything substantial to show in support of either side, apart from the common sense?
(a paragraph in a widely admired book or any document hosted at microsoft.com that uses or prescribes either style over another will answer the question)
if (!condition)andif (condition)are preferred overif (condition == false)andif (condition == true)because the former is just as readable and less verbose.Bottom section of page 13 of C# Coding Standards for .NET created by Lance Hunt says:
However it is not by any means official and it doesn’t come from Microsoft.