.NET Framework? What .NET Framework? Part Deux
The Weird and The Wonderful
1
Posts
1
Posters
7
Views
1
Watching
-
I especially loved this snippit of code I encountered while rewriting an app:
FileInfo fi = new FileInfo(name); DateTime dt = fi.LastWriteTime; int yr = dt.Year; if (yr >= 2000) yr -= 2000; else yr -= 1900; string year = yr.ToString(); if (yr < 10) year = year.PadLeft(2, '0'); /* TODO: Format to be changed for US market */ string date = dt.Day + "/" + dt.Month + "/" + year;
Do I even need to post the alternative?? Me and my colleague (NOT the one who wrote the code. Spent at least 15 minutes laughing about the TODO: comment, too. :p