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


当前回答

在一堆糟糕的剪切和粘贴源代码的内容管理web应用程序:

// load image 1 - JPEG 240x320
img = f1.getImage();
if (check(img))
{
   load(img, Constants.JPEG_240x320);
}

// load image 2 - JPEG 128x128
img = f2.getImage();
if (check(img))
{
   load(img, Constants.JPEG_128x128);
}

...

// load image 13 - GIF 256x256
img = f13.getImage();
if (check(img))
{
   load(img, Constants.GIF256x256);
}

// loaded all of the f**king images

注:大致翻译自意大利语:-)

其他回答

在初始化链表时:

last = first; /* Biblical reference */

简洁而滑稽。

// Singleton object. Leave $me alone.
private static $me;
// this is really complicated

没有其他评论了

'this next if statement - just how it is. don't try to understand it because you won't. :)

这就是工作保障。

我没有亲身经历过这种情况,但这是一个很好的故事(详见我的评论中的解释):

#define MSGTAG_B33R     0x723 /* RIPLVB */