Posted on Thursday 1 December 2005 - Popularity: unranked
The following article has some really funny things seen in sources and documentation listed. Lots of laughable comments and strange constructs from code of various origins. Most will only make a geek laugh, so stay away from the following site if something like this doesn’t make you smile:
Once I had a junior programmer writing VB code that needed to know the day of the week. He decided to write his own code, and read something like:
if (day = 1) or (day = 8 ) or (day = 15) or (day = 22) or (day = 29) then
weekday = “Monday”
elseif (day = 2) or (day = 9) or (day = 16) or (day = 23) or (day = 30) then
weekday = “Tuesday”
…Trying to be educational I asked him for his opinion about his own code, and he said that he would simply modify it every month.
or
I once saw a piece of C code where the programmer needed to move a pointer up 5 spaces in a character array. Rather than writing:
p += 5;
He wrote:
for (int i = 0; i < 5; i++)
p++;










