I'm maintaining some code and have found the following pattern a lot:
var isMale = (row["Gender"].ToString() == "M") ? true : false;
instead of this:
var isMale = (row["Gender"].ToString() == "M");
Is there any reason why anyone would do this? Does anyone think the former is more readable or clearer? Is there some sort of old C "gotcha" that this is a hold-over from?
A valid reason? No.
It's usually produced by people who don't really understand that a condition is also in itself an expression, producing a boolean result. In particular, people schooled on a language where this isn't the case, such as many variants of BASIC.