你遇到过的源代码中最好的注释是什么?
当前回答
Control + A,重写
这是在以前的项目中作为签入注释添加到源代码控制中的注释。
其他回答
//open lid
//take sh!t
//close lid
文件打开,数据转储,文件关闭…
我刚刚在。net的自定义Linq提供程序中找到了这个:
//select is a royal pain in the ass where
//the parameter passed to CreateQuery isn't actually the one that goes in the call
//requiring this workaround. Not sure how straight Linq to Objects does it.
还有这个
//expressions have to be compiled in order to work with the method call on
//straight Enumerable somehow, LINQ to objects itself magically does this.
//Reflector shows a mess, so I (Aaron) invented my own way. God love unit tests!
我刚刚也找到了这个…一切都会变得更好
//ok, this is a hairy, dirty, and nasty piece of code
//the alternatives are substantially worse than this though
//i.e. when you do your own provider, LINQ assumes that
//you are going to implement your own expression tree visitor and
//do it all yourself. Frankly, I still have xmas shopping to do
//and I really don't want us to be foobared when we get
//even more extension methods added to LINQ
//therefore, we are pulling execute based on taking the calling the
//standard execute on enumerable, but using our own class
//
//optimization can occur from here on an as needed basis, that is
//check for the value of mex.Method.Name, and write a handler for
//that method
//
//also, it may not be a bad idea to rather than do this reflection
//each and every time somehow cache the reflected methodinfos and do
//lookups that way that said, we need a complete red/green/refactor
//cycle here before I am touching that one
还有这个
//Compile that mutherf-ker, invoke it, and get the resulting hash
double t = 0.0; /* that's generally my opinion of the diner, too. */
从C #
#region Hack - Shield Eyes Before Expanding
/// <summary>
/// A single uint with all of the bits set to represent the different tracing
/// </summary>
/// <remarks>
/// Ugly I know, so if you can think of a better way, feel free to rewrite.
/// </remarks>
[Browsable(false)]
public uint TraceBitfield
{
// Snip
}
#endregion
//This code sucks, you know it and I know it.
//Move on and call me an idiot later.
推荐文章
- 在构建中编写注释的语法是什么?gradle文件?
- Java注释中的/**和/*
- 有没有办法注释掉.ASPX页面中的标记?
- Jenkins:注释可以添加到Jenkins文件中吗?
- TypeScript注释的语法记录在哪里?
- CSV文件可以有注释吗?
- 什么是自文档化代码?它能取代文档化良好的代码吗?
- 在erb中添加注释的最佳方法
- 为什么Python没有多行注释?
- 我应该在批处理文件中使用哪种注释风格?
- 如何在Office VBA编辑器中注释和取消注释代码块
- “# noqa”在Python注释中是什么意思?
- 我可以向pip需求文件添加注释吗?
- 你遇到过的源代码中最好的注释是什么?
- 在Bash中创建多行注释的方法?