0

Should I add punctuation marks (e. g. ".") in my c# xml comments?

In the official Microsoft xml comment documentation there is now statement. Also you can see in that in this documentation there are some comments with an ending "." and some without.

Picture of microsoft documentation below.

Do you know a official way or got some empirical value?

enter image description here

Peter Macej
  • 4,831
  • 22
  • 49
sampa
  • 535
  • 4
  • 27
  • 1
    Inline comments are different than XML comments which usualy are used to generate documentation. For those purposes proper grammar is desired :-) – Tomek Jan 13 '21 at 08:58
  • Thanks. I see it exactly this way. But I cant find an official statement. Also you see in the microsoft documentation (also for XML Documents) differences (see my updated post). – sampa Jan 13 '21 at 09:38

1 Answers1

2

You definitely should add dots at the end of your sentences. It's even mentioned in the article you provided the link for (in Recommendations at the end):

Documentation text should be written using complete sentences ending with full stops.

The example without a dot on your picture is the only one and it's apparently a mistake. All other XML doc comments have a dot.

While not imperative instructions, I wrote a guide with some tips based on my personal experiences some time ago: Guidelines to Better XML Doc Comments and Documentation

Peter Macej
  • 4,831
  • 22
  • 49