你遇到过的源代码中最好的注释是什么?
当前回答
在一堆糟糕的剪切和粘贴源代码的内容管理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
注:大致翻译自意大利语:-)
其他回答
// woot, global var. I havent done this for a long time.
在1983年的COBOL中见过:
C I don't know what this next bit does so I'll jump around it
GOTO DONE.
我猜它被病毒式传播了,我在一个守护进程(Linux)中发现了以下防止OOM杀手选择它:
/*
* Don't OOM me, bro!
*/
这紧跟在mlockall()之后,以防止进程交换,注释如下:
/*
* Don't swap me, bro!
*/
// this is really complicated
没有其他评论了
在一个著名的商业DOS电子表格应用程序中:
/* This comment was just added in order to check-in a file that was last
checked in by [Insert Programmer FirstName] "Back-to-the-Future" [Insert
Programmer LastName]. While testing for year 2000 problems, he accidentally
checked-in this file while his machine clock was set forward to the year 2000.
This meant that the source code was always newer than the object file and
compiled every time the code was built. I'm checking this file in again to
fix that. */