0

Is there a point in writing comments in code like this?

/// <Remarks>
/// Name of abc - public property.
/// </Remarks>

In visual studio, the intellisense has icons for each type of class member (field, property, etc), so I don't see the point of this. In my current shop we are only using Visual Studio anyway, which provides those icons.

Thanks

Joey
  • 344,408
  • 85
  • 689
  • 683
GurdeepS
  • 65,107
  • 109
  • 251
  • 387
  • DRY, YAGNI. (Not exactly DRY, but *very* close and in the same spirit.) –  Mar 05 '10 at 00:05

1 Answers1

1

Seems fairly useless to me. I'd avoid it, because, as you say, it is something that can be inferred from the code, trivially. (edit: FWIW, maybe it is useful for some tool your organisation runs to do documentation, and the tool is not smart enough to detect properties vs fields, but I doubt this is the case. Nevertheless, that is a potential reason to encode 'redundant' data into the comments (to satisfy a tool (human or not :P)).

Noon Silk
  • 54,084
  • 6
  • 88
  • 105
  • This was a task set for a fellow junior developer. What made me laugh is a coder with less experience (less age - less working experience) was getting his code commented when really it should be his own duty? The xml comments were not going to be executed to a document so what I stated would have been fine. Really strange. – GurdeepS Mar 04 '10 at 23:11