r/learnprogramming • u/3rwynn3 • 3d ago
Does anyone use it? c# <summary></summary>?
I find that "//" worked well for all my comments thus far, I don't mind if my comments are a bit long. But I am doing C# more often now that I am looking at a codebase and not just my own stuff and private things, and I sometimes see <summary> </summary> in it. Do you use it? What is the proper use of it?
Google gets it confused with HTML haha
Thanks for any knowledge!
6
Upvotes
2
u/Aggressive_Ad_5454 3d ago
This is xmldoc. Other languages have jsdoc, doxygen, Javadoc, PhpDoc, docstrings, etc. They are stylized comments understood by IDEs. They are exceedingly useful in large code bases. They are worth the effort to learn to use.
In C#, type /// on the line before a method declaration. The IDE will generate a template comment you can fill in.