你遇到过的源代码中最好的注释是什么?
当前回答
// fix for groupid > 9
// if groupid ever gets to 100 everything will break (again)
if (groupid < 10) {
groupid = "0" + groupid;
}
其他回答
//too much log will kill you
这个评论是我自己写的,当降低一些日志的优先级时,否则会写数百MB的垃圾,严重削弱应用程序的性能。
我最喜欢的(我必须承认我用过很多次):
// Yes...I know this is repulsive and stupid.
// But <%CompanyOwnerOrManagerToken%>, not knowing a thing about code,
// demanded I do it anyways. SO, go crap on their desk, not mine.
// K THX BYE
# Don use this. Never!
我刚刚在一些遗留代码中发现了这个..
'CANNOT JUST QUIT!
我曾经想出了一个我认为很优雅的解决方案来解决一个特别棘手的问题,现在回想起来,这有点令人费解,并且大量使用了宏编程。多年以后,我从一个维护程序员那里发现了这条评论
/* Description: The Total Perspective Vortex derives its picture of the whole Universe on the principle of extrapolated matter analyses. To explain - since every piece of matter in the Universe is in some way affected by every other piece of matter in the Universe, it is in theory possible to extrapolate the whole of creation - every sun, every planet, their orbits, their composition and their economic and social history from, say, one small Macro. The man who invented the Total Perspective Vortex did so basically in order to annoy the IT department. Steve Weet - for that was his name - was a dreamer, a thinker, a speculative philosopher or, as some would have it, a slacker. And they would nag him incessantly about the utterly inordinate amount of time he spent staring out into space, or mulling over the mechanics of Chelsea FC, or doing spectrographic analyses of macros. "Have some sense of proportion!" they would say, sometimes as often as thirty-eight times in a single day. And so he built the Total Perspective Vortex - just to show them. And into one end he plugged the whole of reality as extrapolated from one macro, and into the other end he plugged the IT department: so that when he turned it on they saw in one instant the whole infinity of creation and theirselves in relation to it. To Steve Weet's horror, the shock completely annihilated ' their brains; but to his satisfaction he realized that he had proved conclusively that if life is going to exist in a Universe of this size, then the one thing it cannot afford to have is a sense of proportion. */
推荐文章
- 在构建中编写注释的语法是什么?gradle文件?
- Java注释中的/**和/*
- 有没有办法注释掉.ASPX页面中的标记?
- Jenkins:注释可以添加到Jenkins文件中吗?
- TypeScript注释的语法记录在哪里?
- CSV文件可以有注释吗?
- 什么是自文档化代码?它能取代文档化良好的代码吗?
- 在erb中添加注释的最佳方法
- 为什么Python没有多行注释?
- 我应该在批处理文件中使用哪种注释风格?
- 如何在Office VBA编辑器中注释和取消注释代码块
- “# noqa”在Python注释中是什么意思?
- 我可以向pip需求文件添加注释吗?
- 你遇到过的源代码中最好的注释是什么?
- 在Bash中创建多行注释的方法?