TryParse WTF


Filed under:
Published Posted Friday, November 16, 2007 12:20 PM by Nino

I came across this piece of code today and, while not WTF worthy, it still summoned a sigh of sadness from me, and I thought I would share. Apparantly, the author's understanding of DateTime.TryParse() was not correct.  Enjoy.  Happy Friday.

if (DateTime.TryParse(m_dateChooser.Text, out dt) == true)
{
    return dt;
}
else
{
   
return DateTime.MinValue;
}

 

Comments

. Monday, November 19, 2007 11:32 AM

Man I hope that wasn't mine.

cacharbe