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


当前回答

when :orientation
## Avoid matching gay people with straight people - they hate it, they do, they really do.
query_parameter = "(users.orientation = 'Bi' OR (users.orientation = 'Straight' AND users.gender IN ('#{user.opposite_genders.join('\',\'')}')) OR (users.orientation = 'Gay' AND users.gender IN ('#{user.same_genders.join('\',\'')}')))"

从一个约会网站…

其他回答

我经常看到这种情况:

// TODO make this work
// now swap like a <explicative removed>
catch (Ex as Exception)
{
     // oh crap, we should do something.
}

没有什么比一个空的catch块更能让人觉得代码是健壮的....

using namespace std;            // So sue me

从Joomla !来源:

// fudge the group stuff