你遇到过的源代码中最好的注释是什么?
当前回答
在VB中使用分号。网
TextBox2.Visible = True';
For Each row In data.Tables(0).Rows
If row("Customers.Id").ToString <> customerId Then
customerId = row("Customers.ID").ToString';
name = "Customer Name: " & row("Name").ToString & CrLf';
address = "Address: " & row("Address").ToString & CrLf & CrLf';
TextBox2.Text += name & address ';s
End If';
Next';
其他回答
首先,在一个大对象的更新的开始:
/*General note to all who tread in the <ObjectName>() code...
* The SetOriginals() method from the BaseEntity class should be called (and only called) right after the Get() method
* call as seen above. Calling the SetOriginals method elsewhere will result in bugs and all kinds of other nasty suprises.
*/
然后在大约200行逻辑之后更新对象:
//Attempt to explain this confusing mess of code:
//First time you save an actual absence this is what happens:
//0. The first save saves to the <TableName> table (among other things). (Fig. A)
//1. The <CalculationMethod> method is called next which inserts to the <OtherTableName> table.
//(This is the table that keeps track of credits to the case.) (Fig. B)
//2. So then you have to call <UpdateCalculations> to move the <TableName> records to the <ThirdTableName> table. (Fig. C)
//3. Then you go back and run calculations since you have the debits table (<ThirdTableName>) populated. (Fig D.)
//4. Then a final save to save the calculations back to the case. (Fig. E)
//Yeah, I know what you're thinking: this sucks. 10/01/07 XXX
开发商是对的……这太糟糕了!
try {
doSomething();
} catch(err) {
// Die quietly
alert(err);
}
注意上面代码中的bug;我只是证明了它是正确的,并没有尝试过。
这是唐纳德·克努斯写的。
在XSLT文件的头文件中:
DON'T TOUCH THIS SCRIPT -> XSLT is like arcane, black magic
我相信在JBoss的某个地方有一行写着
return null; //Not really null
我一直很喜欢这句话。
推荐文章
- 在构建中编写注释的语法是什么?gradle文件?
- Java注释中的/**和/*
- 有没有办法注释掉.ASPX页面中的标记?
- Jenkins:注释可以添加到Jenkins文件中吗?
- TypeScript注释的语法记录在哪里?
- CSV文件可以有注释吗?
- 什么是自文档化代码?它能取代文档化良好的代码吗?
- 在erb中添加注释的最佳方法
- 为什么Python没有多行注释?
- 我应该在批处理文件中使用哪种注释风格?
- 如何在Office VBA编辑器中注释和取消注释代码块
- “# noqa”在Python注释中是什么意思?
- 我可以向pip需求文件添加注释吗?
- 你遇到过的源代码中最好的注释是什么?
- 在Bash中创建多行注释的方法?