|
|
|
|
|
by bdibs
2728 days ago
|
|
My comment was directed to the OP's question of comment:code ratio in general, not in this exact circumstance. Additionally, in no way am I advocating for no comments, that's obviously not possible (like your example). Comments are useful, even necessary, for code that might have an otherwise confusing logic to them. I've seen plenty of code with documentation for a method with nothing more than: /**
* Bills the user
*
* @param user The user to bill
*/
public void billUser(User user) {
//
}
In my opinion, that comment is completely redundant, and I think it's driven by the idea that we should comment EVERYTHING. |
|
I see this as someone trying to fool a linter that demands they have documentation. I think it's better to say "comment everything" because it puts documentation as a first-class consideration rather than an afterthought.