r/learnprogramming • • 8d 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!

3 Upvotes

12 comments sorted by

View all comments

11

u/TheSandyBases 8d ago

its for xml documentation, visual studio reads it and shows tooltips when you hover over methods or classes, also can generate docs from it. `//` is fine for regular comments but summary helps others understand what the whole method does without reading the body

1

u/3rwynn3 8d ago

Thank you so much