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


当前回答

一段时间前我在一个PHP CMS中添加的注释。

if (/*you*/ $_GET['action']) { //celebrate

其他回答

我在一个充满显式怪异类型转换的函数中见过这段代码:

// Since today's CPUs are really fast, this is dedicated to those who said:
// " You can't use Moore's Law as an excuse to write bad software. "

代码太可怕了:)

最初的《毁灭战士》拥有一个带有静态墙壁的引擎,但却不能移动;结果,所有的门都是垂直打开的;任何东西都不可能水平移动。当源代码发布后,我在查看代码时,在处理门的源文件中看到了这个,在一大块注释掉的代码的开头:

// UNUSED
// Separate into p_slidoor.c?

#if 0           // ABANDONED TO THE MISTS OF TIME!!!
//
// EV_SlidingDoor : slide a door horizontally
// (animate midtexture, then set noblocking line)
//

以下是4个,排名不分先后:

// Father, forgive me, for I am sinning

// heaven help me

// horse string-length into correctitude 
(from a textbook)

// what, me worry?
'""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
'
'  NOTE: DON'T SCREW WITH THIS CODE UNLESS YOU REALLY UNDERSTAND IT!
'
'""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
// Caveat implementor