How to deal with tautology in comments?

Posted by Tamás Szelei on Programmers See other posts from Programmers or by Tamás Szelei
Published on 2012-03-29T08:26:39Z Indexed on 2012/03/29 17:41 UTC
Read the original article Hit count: 300

Filed under:

Sometimes I find myself in situations when the part of code that I am writing is (or seems to be) so self-evident that its name would be basically repeated as a comment:

class Example
{
    /// <summary>
    /// The location of the update.
    /// </summary>
    public Uri UpdateLocation { get; set; };
}

(C# example, but please refer to the question as language-agnostic).

A comment like that is useless; what am I doing wrong? Is it the choice of the name that is wrong? How could I comment parts like this better? Should I just skip the comment for things like this?

© Programmers or respective owner

Related posts about programming-practices