M
Mark Wilden
Jon Skeet said:Because in this *one* case, it's dangerous to put the variable first
and the value second. In non-boolean cases, the compiler will throw an
error at you.
Actually, I was just commenting on why we C# programmers would care about an
ancient C compiler.
Note that although many of us treat all warnings as errors and would
spot any warnings, not everyone does - if a warning for
"if (x = false)" goes unnoticed, that could be pretty serious.
I do treat warnings as errors, myself, and I also write unit tests.
Of course, as I've already posted, I prefer if (!x) in the first
place...
Me too.
///ark

