Echadle un ojo:
http://rinkworks.com/stupid/cs_programming.shtmlLa que mas me ha hecho gracia:
This little bit of Java was written as part of a group project at university. The friend who passed it to me has been bouncing off the walls about the quality of the guilty party's code (silly things like defining error and success codes with the same value so you don't know what the return code means and stuff like that), but this is the most obviously stupid bit.
public int convertItoi(Integer v)
{
if (v.intValue()==1) return 1;
if (v.intValue()==2) return 2;
if (v.intValue()==3) return 3;
if (v.intValue()==4) return 4;
if (v.intValue()==5) return 5;
if (v.intValue()==6) return 6;
if (v.intValue()==7) return 7;
return 0;
}
CitarI found this comment in some code I had to maintain:
/* This function is BOOL but actually returns TRUE,
FALSE and -2 because I've no time to change it
to int */
Didn't it take more time to write the comment?
Supongo que el gringo tiene razón XDDDD.