你遇到过的源代码中最好的注释是什么?
当前回答
// Hey, your shoe's untied!
后面跟着一些可疑的代码,在这些代码中,
// Keep looking! I think it was the other shoe!
最后,
// How strange -- I must be seeing things. Anyhow, I'm going to go take a shower, now...
其他回答
//There can Only Be one HIGHLAN....err..Singleton
public class SomeSingleton
{
...
}
我最喜欢的评论是我的一个同性恋朋友说的。他喜欢用VB标记他所有的TODO注释。净,
'TODO: Matt Damon
有时会提供额外的信息,但通常不是这样。
//Not a bug, parameter position can change..., if you think this is wrong, you are in fact wrong.
Case 1:
...
break;
...
//I don't want do do this but [my coworker] says it's part of the code standard
default:
break;
这一点对其他人来说很有趣,但对我来说就不那么有趣了。我从一个开发人员那里继承了代码(ASP),而他自己也继承了它。第一个程序员编写了一些很难理解的代码。第二个开发者添加了如下评论(为了保护不那么无辜的人,名字被隐藏了):
'This code was written by **************.
'I haven't a clue what it does. He hasn't a clue what it does.
'Nobody else has a clue what it does or how it does it.
'It is something to do with data but **** knows what.
'The ******* still works so please do not change this code,
'even though it is a complete pile of ****.
那我为什么不觉得有趣呢?嗯,这是一个客户内部网的ASP代码。
...正是那位顾客向我强调了这条评论。
:-(
推荐文章
- 在VS Code中禁用“Comments are not allowed In JSON”错误
- Swift:理解// MARK
- 在构建中编写注释的语法是什么?gradle文件?
- Java注释中的/**和/*
- 有没有办法注释掉.ASPX页面中的标记?
- Jenkins:注释可以添加到Jenkins文件中吗?
- TypeScript注释的语法记录在哪里?
- CSV文件可以有注释吗?
- 什么是自文档化代码?它能取代文档化良好的代码吗?
- 在erb中添加注释的最佳方法
- 为什么Python没有多行注释?
- 我应该在批处理文件中使用哪种注释风格?
- 如何在Office VBA编辑器中注释和取消注释代码块
- “# noqa”在Python注释中是什么意思?
- 我可以向pip需求文件添加注释吗?