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


当前回答

来自sendmail配置文件。一页又一页看起来就像线条噪音。我发现了这块宝石。

# insert this handy debugging line wherever you have problems
#R$*                $:$>99$1

其他回答

aComment = 'this is not aComment' # this is aComment
class T(object):
    def f(this):
        this is not aComment
//I am not sure why this works but it fixes the problem. 

这是之前的一组代码,技术上确实解决了问题,它的意思是,但打破了其他3个东西....

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

A:很简单——就是那个帮我解决了我当时遇到的任何问题的人,而且有很多这样的人!

其次是那些帮助指导新开发避免已知陷阱的方法。

// this is really complicated

没有其他评论了

我经常看到这种情况:

// TODO make this work