We've seen this pattern many times here:
return (someCondition) ? true : false;
or
if (someCondition)
{
return true;
}
else
{
return false;
}
There are many variations on it, all of which highlight someone's misunderstanding of boolean expressions. Today Kerry sends us a "fun" little twist, in C#.
return (someCondition || someOtherCondition) ? Boolean.Parse("true") : Boolean.Parse("false");
The conditions have been elided by Kerry, but they're long and complicated, rendering the statement less readable than it appears here.
But here we've taken the "if-condition-return-condition" pattern and added needless string parsing to it.
