你遇到过的源代码中最好的注释是什么?
当前回答
// this is really complicated
没有其他评论了
其他回答
我想我有过这样的经历:
if (case1) { // trivial
...
}
else { // we are screwed
/* fill in later */
}
好吧,我可能用了一个比搞砸更强烈的词
大概30页的xslt的中间部分
<!-- Here be dragons -->
//ALL YOUR BASE ARE BELONG TO US
...这让我的老板以为有人黑进了系统。他不知道这个笑话。
我们的团队,就在今晚,发布了一个新版本的CSS文件,删除了一个文件的注释,该文件的结构是这样的:
@charset "UTF-8";
/* Who knew comments here could COMPLETELY ruin our page in Safari? */
body {
/* Really important stuff here */
/* Of course, comment or not, this will all get ignored by Safari because
its the first rule after the comments which break everything.
see http://www.w3.org/International/questions/qa-css-charset for the exact details!
*/
}
有趣的是,在网上你会发现人们的解决方案是输入一个虚假的元素作为字符集语句下面的第一条规则,然后被忽略,照常进行…
发人深省的问题:该把不评论的评论放在哪里?
旁注:我知道这是不需要的,因为头,元规则等。不幸的是,我们需要它作为一个catch all:(
// Empty constructor to satisfy the stupid compiler
Public ServletHandlerClass () { }
推荐文章
- 在VS Code中禁用“Comments are not allowed In JSON”错误
- Swift:理解// MARK
- 在构建中编写注释的语法是什么?gradle文件?
- Java注释中的/**和/*
- 有没有办法注释掉.ASPX页面中的标记?
- Jenkins:注释可以添加到Jenkins文件中吗?
- TypeScript注释的语法记录在哪里?
- CSV文件可以有注释吗?
- 什么是自文档化代码?它能取代文档化良好的代码吗?
- 在erb中添加注释的最佳方法
- 为什么Python没有多行注释?
- 我应该在批处理文件中使用哪种注释风格?
- 如何在Office VBA编辑器中注释和取消注释代码块
- “# noqa”在Python注释中是什么意思?
- 我可以向pip需求文件添加注释吗?