你遇到过的源代码中最好的注释是什么?
当前回答
早在80年代早期,我在汇编器中看到了这个(引用于模糊的记忆):
I don't understand how the following bit works, but it worked in the program I stole it from.
其他回答
//too much log will kill you
这个评论是我自己写的,当降低一些日志的优先级时,否则会写数百MB的垃圾,严重削弱应用程序的性能。
/**
* If you don't understand this code, you should be flipping burgers instead.
*/
好吧,这些是我的,所以WTF是我,正如CodingHorror所说:
//#region Code for weird cases - do you really want to know?
我曾经在一些ASP中留下了这样的评论:
' Commented out following code, don't delete for when [CustomerName] changes his mind
碰巧,[CustomerName]没有改变他的想法,但他确实有访问web服务器,他确实找到了那行…
我没有亲身经历过这种情况,但这是一个很好的故事(详见我的评论中的解释):
#define MSGTAG_B33R 0x723 /* RIPLVB */
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 .__ _.-\ \
## | | | ``/ /` /
## /,_| | /,_/ /
## /,_/ '`-'
##
推荐文章
- 在构建中编写注释的语法是什么?gradle文件?
- Java注释中的/**和/*
- 有没有办法注释掉.ASPX页面中的标记?
- Jenkins:注释可以添加到Jenkins文件中吗?
- TypeScript注释的语法记录在哪里?
- CSV文件可以有注释吗?
- 什么是自文档化代码?它能取代文档化良好的代码吗?
- 在erb中添加注释的最佳方法
- 为什么Python没有多行注释?
- 我应该在批处理文件中使用哪种注释风格?
- 如何在Office VBA编辑器中注释和取消注释代码块
- “# noqa”在Python注释中是什么意思?
- 我可以向pip需求文件添加注释吗?
- 你遇到过的源代码中最好的注释是什么?
- 在Bash中创建多行注释的方法?