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


当前回答

在一个巨大的800行'switch'语句中,在中间的某处:

// Joe is sorry

几百行之后……

// Harry is sorry too

其他回答

我经常看到这种情况:

// TODO make this work

注意上面代码中的bug;我只是证明了它是正确的,并没有尝试过。

这是唐纳德·克努斯写的。

// Magic. Do not touch.

经典ASP:

'Is it worth it, let me work it'
'I put my thing down, flip it and reverse it'
'Ti esrever dna ti pilf, nwod gniht ym tup I'

NextIP = StrReverse(UserRecordset.Fields.Item(0))

我不止一次使用过这个方法,当我对一个数学公式做了一些不明显的简化时,我不想记录:

//this formula is right, work out the math yourself if you don't believe me