你遇到过的源代码中最好的注释是什么?
当前回答
我们有一个文件,在它的一半,一个程序员试图弄清楚混乱的意义,设法将所有无意义的代码移到底部,并留下了这样的评论:
I have no idea what this stuff does below here.
另一名程序员留下了一系列嵌套的命名空间,这些命名空间的作用类似于“方向手册”,这样您就可以钻取想法中的名称空间并选择您的操作。
其他回答
I was doing a database in Access, very simple thing - at least it was supposed to be at the start or I would have done it in Delphi. The client wanted to be able to get the customer info out of the database but they would not enter enough information to reliably identify the customer. I told them to use the phone number as the key as each customer (the way they worked, not for everyone) would have a different number. After a few frantic calls from them, (It's not working we can't enter the customer) I discovered that they were too lazy to look up the phone numbers from their old system and were trying to enter all the numbers they did not know as "n/a". In trying to sort this out for them I ended up with a lot of checking loops in the code and had the comment beside one outcome "This should never be reached if they do what they are supposed to do!!!!!!!!!"
他们还曾经问过我:“即使我们输入了错误的地址,我们如何才能找到正确的客户?”而这一切都是为了花生。
// somedev1 - 6/7/02 Adding temporary tracking of Login screen
// somedev2 - 5/22/07 Temporary my ass
在开发团队中每个人都在大量编辑的代码文件头部:
'Avert your eyes, it may take on other forms!
好弗兰德斯。
// need a coffee to fix this.
这是显而易见的?
/** Logger */
private Logger logger = Logger.getLogger();
推荐文章
- 在VS Code中禁用“Comments are not allowed In JSON”错误
- Swift:理解// MARK
- 在构建中编写注释的语法是什么?gradle文件?
- Java注释中的/**和/*
- 有没有办法注释掉.ASPX页面中的标记?
- Jenkins:注释可以添加到Jenkins文件中吗?
- TypeScript注释的语法记录在哪里?
- CSV文件可以有注释吗?
- 什么是自文档化代码?它能取代文档化良好的代码吗?
- 在erb中添加注释的最佳方法
- 为什么Python没有多行注释?
- 我应该在批处理文件中使用哪种注释风格?
- 如何在Office VBA编辑器中注释和取消注释代码块
- “# noqa”在Python注释中是什么意思?
- 我可以向pip需求文件添加注释吗?