terça-feira, 5 de junho de 2012

Qual é o melhor comentário de código-fonte que você já encontrou?

Comentar um código é uma arte, e alguns fazem dessa arte uma comédia :)
stop(); // Hammertime! :D :D


// sometimes I believe compiler ignores all my comments


// 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.



//When I wrote this, only God and I understood what I was doing
//Now, God only knows


Exception up = new Exception("Something is really wrong.");
throw up; //ha ha

/**
* Always returns true.
*/
public boolean isAvailable() {
return false;
}
//If this comment is removed the program will blow up

//Dear future me. Please forgive me.
//I can't even begin to express how sorry i am

option. BatchSize = 300; //Madness? THIS IS SPARTA!!

long long ago; /* in a gallaxy far far way*/

// I have to find a better job

// hack for ie browser (assuming that ie is a browser)

} catch (PartInitException pie) {
// Mmm... pie
}

// John! If you'll svn remove this once more,
// I'll shut you, for God's sake!
// That piece of code is not “something strange”!
// That is THE AUTH VALIDATION.

try {

}
catch (SQLException ex) {
// Basically, without saying too much, you're screwed. Royally and totally.
}
catch(Exception ex)
{
//If you thought you were screwed before, boy have I news for you!!!
}

// Catching exceptions is for communists

// If you're reading this, that means you have been put in charge of my previous project.
// I am so, so sorry for you. God speed.

// if i ever see this again i'm going to start bringing guns to work

// The magnitude of this hack compares favorably with that of the national debt.

//ALL YOUR BASE ARE BELONG TO US

// If this code works, it was written by Paul. If not, I don't know who wrote it

//You are not expected to understand this

/**
* If you don't understand this code, you should be flipping burgers instead.
*/

'NO COMMENT

//Abandon all hope yea who enter beyond this point

//Mr. Compiler, please do not read this.

catch (Ex as Exception)
{
// oh crap, we should do something.
}

// TODO make this work

// If you delete the credits, I will fucking kill you.

// This is crap code but it's 3 a.m. and I need to get this working.

// For the sins I am about to commit, may James Gosling forgive me

// Houston, we have a problem

// If I from the future read this I'll back in time and kill myself. 
 
 
 
Fonte:
http://chronicdistraction.com/funny-programming-comments/
http://www.citehr.com/353146-best-comment-source-code-you-have-ever-encountered.html
http://www.emailjokez.com/more/46275_What-is-the-best-comment-in-source-code-you-have-ever-encountered.htm?active_image=462754-ATT00004_63738_46275_1.jpg#subject

6 comentários:

Anônimo disse...

Madness? THIS IS SPARTA!!

David Sena

Unknown disse...

//When I wrote this, only God and I understood what I was doing
//Now, God only knows

Parece até que foi eu quem escreveu esse código. kkk

Unknown disse...
Este comentário foi removido pelo autor.
Arthur disse...

Um dia eu vou fazer uma prova toda com código, para o aluno colocar 'somente' os comentários em pontos chave, explicando o que o código está fazendo. Quando eu ministrei Fundamentos de Programação, fiz uma questão assim na prova e só uma pessoa acertou ela toda.

Camilo disse...

Ao invés de pedir um comentário, eu pediria um teste de unidade! :)

Bonilha disse...

muito bom esse post huahuahuahua