I see some code snippets like this:
[Description("This method is used to do something.")]
static void SomeMethod()
{
}
I am wondering if what we want is just to describe the meaning of the method, why not just use the following comments:
/// <summary>
/// This method is used to do something.
/// </summary>
static void SomeMethod()
{
}
Actually, the comment style can be leveraged by IntelliSense. So why do we bother to use an attribute?
Update
So, though not very accurate, I take Attributes as run time version of comment. While comment is only for edit time.