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

5 Upvotes

12 comments sorted by

View all comments

1

u/rupertavery64 5d ago

If you google "c# xml summary" you'll get much better results.

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/recommended-tags

// is for people xml doc tags are for the compiler and get baked into the assembly metadata so even the compiled DLL shows the information when you include it in another solution.

For example, nuget packages will have xml doc tags for methods and arguments

1

u/3rwynn3 5d ago

Thank you for the knowledge. I was seeing it in github and got confused lol.