
Hace algún tiempo comenzó en Stack Overflow (sitio de preguntas y respuestas técnicas) una pregunta anónima que decía así:
¿Cuál es el mejor comentario de código que hayais encontrado?
Esta pregunta existe porque tiene importancia histórica, pero no se considera una pregunta relevante en este sitio web, así que por favor no la useis como prueba o evidencia para volver a hacer preguntas similares aquí
El resultado de dichas respuestas fue una avalancha de comentarios de código, muchos de ellos verdaderas obras de arte, bromas y situaciones en las que muchos nos hemos sentido identificados por nuestras experiencias personales. Aquí os dejo una selección de algunos de los mejores que hemos encontrado aunque os confieso que no los he podido leer todos. Si encontrais alguno que os guste sed libres de dejarlos en los comentarios.
/* OK; before you read the following code know what I am trying to do. I needed to get the list of child catagories from the root node so that the root node didn’t appear in the selection box. But for some stupid fucking reason the stupid fucking DBA wont let me access the items using indices and I instead have to use their stupid fucking Iterator implementation. So there. */
$firstList = $this->getRootNode()->getChildren();
foreach ($firstList as $node)
{ $nodes = $node->getChildren(); break; // wtf?
}
// if i ever see this again i’m going to start bringing guns to work
//hack for ie browser (assuming that ie is a browser)
/**
For the brave souls who get this far: You are the chosen ones,
the valiant knights of programming who toil away, without rest,
fixing our most awful code. To you, true saviors, kings of men,
I say this: never gonna give you up, never gonna let you down,
never gonna run around and desert you. Never gonna make you cry,
never gonna say goodbye. Never gonna tell a lie and hurt you. */
//
// Dear maintainer:
//
// Once you are done trying to ‘optimize’ this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
//
// total_hours_wasted_here = 16
//
// no comments for you
// it was hard to write
// so it should be hard to read
// I will give you two of my seventy-two virgins if you can fix this.
// I am not responsible of this code.
// They made me write it, against my will.
//Dear future me. Please forgive me.
//I can’t even begin to express how sorry I am.
// I dedicate all this code, all my work, to my wife, Darlene, who will
// have to support me and our three children and the dog once it gets
// released into the public
Fuente y más comentarios | StackOverflow