T
tjb
I often see code like this:
/// <summary>
/// Removes a node.
/// </summary>
/// <param name="node">The node to remove.</param>
public void RemoveNode(Node node) {
<...>
}
In my view, there is no benefit in doing this. It brings nothing to the
table, and creates the following issues:
o It get in the way of the code -- it's unnecessary noise.
o When something significant changes, both the code and the comment
need to be updated, rather than just the code.
o It often breeds bad code ("don't worry about giving that method a
better name -- the comment explains it well").
I've seen some pretty knowledgeable people write code like this, mind you.
Why do people do it? Is it just a consistency thing? Must every single
method be commented?
/// <summary>
/// Removes a node.
/// </summary>
/// <param name="node">The node to remove.</param>
public void RemoveNode(Node node) {
<...>
}
In my view, there is no benefit in doing this. It brings nothing to the
table, and creates the following issues:
o It get in the way of the code -- it's unnecessary noise.
o When something significant changes, both the code and the comment
need to be updated, rather than just the code.
o It often breeds bad code ("don't worry about giving that method a
better name -- the comment explains it well").
I've seen some pretty knowledgeable people write code like this, mind you.
Why do people do it? Is it just a consistency thing? Must every single
method be commented?