Remember, Remember the Thirty-Third of November
by in CodeSOD on 2013-10-28Some say that time is nothing but an illusion. The degree to which some software developers struggle with times and dates certainly suggests mysterious and unknowable forces swirling beyond the brink of human understanding. Consider this code that Ian found while pruning an old application. It's meant to provide the correct suffix for any given day of the month:
string num = "th";
int day = Convert.ToInt16(DateTime.Now.ToString("dd"));
switch(day)
{
case 1:
num = "st";
break;
case 21:
num = "st";
break;
case 31:
num = "st";
break;
case 2:
num = "nd";
break;
case 22:
num = "nd";
break;
case 3:
num = "rd";
break;
case 33:
num = "rd";
break;
default:
num = "th";
break;
}
Leighton started his career as an apprentice ICT technician for a Secondary school. The job was roughly what you would expect, but the interview went down as one of the most surreal moments of Leighton's life. With his first interview scheduled to begin at 9:15 AM, Leighton arrived forty-five minutes early in his new suit and tie. At T-minus two minutes he remained the only candidate in the reception area, and his confidence was growing. But at 9:13, in walked Dave.