你遇到过的源代码中最好的注释是什么?
当前回答
问:“你遇到过的源代码中最好的注释是什么?”
A:很简单——就是那个帮我解决了我当时遇到的任何问题的人,而且有很多这样的人!
其次是那些帮助指导新开发避免已知陷阱的方法。
其他回答
# There is a bug in the next line. $searchParameters != {} will always return true, because {} is creating
# a new hash reference on the fly, and the inequality operater is comparing the memory location of it
# to the memory location of $searchParameters, and they will always be different.
# This means that the following code will always get executed as long as $nodes is defined.
# I'm leaving it there because it has always been there, and although I'm sure it was originally meant to
# mean %$searchParameters (essentially "is this hash not empty"), I'm afraid to change it.
if ( $nodes && $searchParameters != {} )
{
http://fxr.watson.org/fxr/source/pci/if_rl.c 是好的来源。
def leppard
# what, i cant have my own convention?
end
// TODO: not this
上面写了一个同事迫切需要优化的查询。替他说句话,当时我们几个月都是每周工作70个小时……
#ifdef TRACE
#undef TRACE /* All your trace are belong to us. */
#endif
#define TRACE ....