Another miss
-
I found this in one of my older projects:
if (DateTime.TryParse(TB_BuildYear.Text, out buildYear))
buildYear = buildYear;
else
error += "The build year you have entered is invalid\r\n";One of these cases where not just using the variable but checking the value would have been better. Alternatively I could have used empty curly brackets instead.
-
I found this in one of my older projects:
if (DateTime.TryParse(TB_BuildYear.Text, out buildYear))
buildYear = buildYear;
else
error += "The build year you have entered is invalid\r\n";One of these cases where not just using the variable but checking the value would have been better. Alternatively I could have used empty curly brackets instead.
if (!DateTime.TryParse(TB_BuildYear.Text, out buildYear))
error += "The build year you have entered is invalid\r\n";You mean this?
-
I found this in one of my older projects:
if (DateTime.TryParse(TB_BuildYear.Text, out buildYear))
buildYear = buildYear;
else
error += "The build year you have entered is invalid\r\n";One of these cases where not just using the variable but checking the value would have been better. Alternatively I could have used empty curly brackets instead.