你遇到过的源代码中最好的注释是什么?
当前回答
我经历了一个睡眠不足的编程过程,开始只写引用自《搏击俱乐部》的评论。
多年后,我仍然在浏览代码,发现了一条让我发笑的评论。大多数只是随机的想法。然而,我确实保持我的评论行比率相当好!
// This shouldn't happen. The only way this can happen is if the
// <code>JFileChooser</code> has returned a <code>File</code> that doesn't exist
// on the system. If this happens we can't recover, and there is more than likely
// a rip in the space time continuum that the user is too distracted by to notice
// anything else.
/**
* This method leverages collective synergy to drive "outside of the box"
* thinking and formulate key objectives into a win-win game plan with a
* quality-driven approach that focuses on empowering key players to drive-up
* their core competencies and increase expectations with an all-around
* initiative to drive down the bottom-line. I really wanted to work the word
* "mandrolic" in there, but that word always makes me want to punch myself in
* the face.
*/
private void updateFileCountLabel() {
其他回答
// TODO: Delete
// For the sins I am about to commit, may James Gosling forgive me
//If the Current Record is Getting End Dated, We should not create New History Entry.
//We Just need to Update the Previous History Entry
//If the History is already End Dated and the New Record is now removing End Date, Then
//We should not update the Previous History End Date.
//We Just need to Create the New History Record Only.
//Alright..
//Alright....
//Enough Comments. Code it. :-)
#define SHIT_HAPPENED (BASE + 1) /* generic shit happened */
不是在代码中,而是在相关的bug跟踪系统中:
这不可能是我代码中的bug。我非常小心地编码。
推荐文章
- 在构建中编写注释的语法是什么?gradle文件?
- Java注释中的/**和/*
- 有没有办法注释掉.ASPX页面中的标记?
- Jenkins:注释可以添加到Jenkins文件中吗?
- TypeScript注释的语法记录在哪里?
- CSV文件可以有注释吗?
- 什么是自文档化代码?它能取代文档化良好的代码吗?
- 在erb中添加注释的最佳方法
- 为什么Python没有多行注释?
- 我应该在批处理文件中使用哪种注释风格?
- 如何在Office VBA编辑器中注释和取消注释代码块
- “# noqa”在Python注释中是什么意思?
- 我可以向pip需求文件添加注释吗?
- 你遇到过的源代码中最好的注释是什么?
- 在Bash中创建多行注释的方法?