问题描述
我一直在寻找一段时间,虽然我不是新编程,但评论标准一直是我从未真正理解过的东西。我知道每个人都会有不同的概念,但一般来说我的问题是:
假设我有一个按钮,并希望在后面的代码中注释click方法。
Ive been searching for some time, and while im not exactly new to programming, commenting standards has always been something i have never really grasped properly. I know everyone will have a difference concept, but in general my question is:
Say i have a button, and wish to comment the click method in the code behind.
/// ************************************************************************
///
/// ************************************************************************
protected void randomButton_Click(object sender, EventArgs e)
{
// Does something
}
在评论部分,am我的意思是评论方法实际上做了什么,或者实际上它是一个按钮点击事件?
例如。 //在randomButton上触发的方法点击
或
//这个方法做一些随机功能等等等等。
任何建议都会受到赞赏,提前谢谢。
In the comment section, am i meant to be commenting what the method actually does, or that infact it is a button click event?
eg. // Method that fires on randomButton click
or
// This method does some random functionality blah blah.
Any advice would be appreciated, thanks in advance.
推荐答案
/// <summary>
/// Method button click event. Get data for the selected method
/// </summary>
/// <param name="sender">
/// object sender.
/// </param>
/// <param name="e">
/// Event arguments
/// </param>
protected void buttonMethod_Click(object sender, EventArgs e)
{
}
这篇关于正确评论代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!