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


当前回答

这实际上是我在实现原型转换为实际代码时所做的:

// Abandon all hope you who needs to debug this

是的,有比我聪明的人在之后重构了代码(它必须有一个好的结局)。

其他回答

# 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 != {} )
{
def format_ticket_content(text, recursive = true)
  if text.is_a?(TicketNote)
    note = text
    text = note.content
  else
    note = nil
  end

  ## Safety pig has arrived!
  text = h(text)
  ##                               _
  ##  _._ _..._ .-',     _.._(`))
  ## '-. `     '  /-._.-'    ',/
  ##    )         \            '.
  ##   / _    _    |             \
  ##  |  a    a    /              |
  ##  \   .-.                     ;  
  ##   '-('' ).-'       ,'       ;
  ##      '-;           |      .'
  ##         \           \    /
  ##         | 7  .__  _.-\   \
  ##         | |  |  ``/  /`  /
  ##        /,_|  |   /,_/   /
  ##           /,_/      '`-'
  ## 
// John! If you'll svn remove this once more,
// I'll shut you, for God's sake!
// That piece of code is not “something strange”!
// That is THE AUTH VALIDATION.

你怎么看?下面的代码是安全的“svn删除”。

/*
* Wirzenius wrote this portably, Torvalds fucked it up :-)
*/

大学时代:

//why the f*** we have to move this here to make it work

当我们和教授一起复习的时候,它在印刷资料中被突出了。

原因是:一些与缓冲区溢出相关的严重错误,影响了代码中其他位置的文件处理程序中不相关的变量。移动变量将使它再次工作。