你遇到过的源代码中最好的注释是什么?


当前回答

/*************************** Drag And Drop Section - Start (you should be me to mess with this section)*********************************************/

其他回答

// This code sucks.
// set break point here - you'll never reach it
/*
* After 36 hours, 2 holes in my wall and writing my code right beside the API
* this still doesn't work.
* function getMap():void takes in an event object @param: evt:mouseEvent
* I will now retire for the day with a bottle of rum and 2 hours of crying
*/
//MailBody builders for two outgoing messages
StringBuilder hanz = new StringBuilder();
StringBuilder franz = new StringBuilder();

当我读到这篇文章时,我仍然会笑出声来……

我尤其对此感到内疚,在我的大多数项目中嵌入了非建设性的注释、代码诗歌和小笑话(尽管我通常有足够的理智在发布代码之前删除任何直接冒犯的内容)。这里有一个我特别喜欢的,放置在一个设计很差的“上帝物体”下面:

/**
* 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 = 42
//