I don't know if you have heard of The Daily WTF site where bad code across all languages is flogged on a near daily basis. There is a lot of funny stuff, but the best (worst) was this one:
I think he forgot
function return_nothing()
{
return;
}
Diogo is part of a "specialist" team that was brought in to replace a handful of other developers who had spent the past year or so unsuccessfully building an accounting system. Since the project was months behind deadline and had never produced a working deliverable, management dismissed the team and handed the "specialists" the code with the hopes that they could "just make it work." Looking at the code from the old team, I think this should be a fairly easy task; after all, everything is completely self-documenting.
function return_signature($SIGNATURE)
{
return $SIGNATURE;
}
function return_note($NOTE)
{
return $NOTE;
}
function return_false()
{
return false;
}
function return_opposite_of_search_list($search_list)
{
if ($search_list == '0') return true;
return false;
}
I think he forgot
function return_nothing()
{
return;
}
13 May 2008 22:23:48
// Will turn anything into gold!
function holy_shit ($feces) {
return $feces;
}
23 Jul 2008 21:19:23
Looks like temp code written during initial / design phase. like "//TODO: Add signature quesry and return DB result." Perhaps they just did not have time to implement yet. Not that I defend "design by coding" but this looks a bit unfair.