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


当前回答

// Catching exceptions is for communists

来自Mike Duncan在SQLite上的页面。

其他回答

消毒:

//Forward declarations:

class X {}; // TODO: Remove {}  ! When we get X defined....

我看到有人对代码的评论:

// This comment is self explanatory.

我猜他是想说“可变的”,但这个错误造成了一个有趣的评论……想想这里的循环逻辑,以及写它的徒劳。

// I love the smell of dirty XML in the morning
xml = xml.Replace("xmlns=\"urn:bsd.orion/inventory\"", "");

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

// Joe is sorry

几百行之后……

// Harry is sorry too
//I am not sure why this works but it fixes the problem. 

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