In the MSDN Attributes Tutorial they use Author
as an example for an attribute:
[Author("Jane Programmer", Version = 2), IsTested()]
class Order
{
// add stuff here ...
}
This seemed to me to be a good idea because it would allow you to use reflection to group classes by author (for example) - effectively exposing metadata that would normally be in documentation to the compiler, which could be useful. I immediately thought "aha! I should be using attributes for all my inline block documentation" - e.g.:
[Author("Me")]
[Description("Add 1 to value")]
[Param("value", "The original value to add 1 to")]
public int AddOne(value) {return value + 1;}
However none of the answers I could find about documentation and attributes seem to suggest this method. They all use XML for inline documentation.
Are there any built-in attributes to assist with inline documentation? If not, are there any libraries / packages out there that include pre-defined sets of attributes for inline documentation?
/** */
syntax instead of that stupid///
? Also, XML is dead.@""
multiline strings. And C# programmers are already used to reading C# code (rather than XML). But maybe you could just use this method for Author and Parameters and not for description? And surely the run-time overhead is not great. It would be compile-time if anything...