User persists in his belief that excessive comments aren't a bad thing; is he right?

5 days ago

In order to avoid further cluttering of the question's comment section, I will elaborate here on my stance. At the same time I would like to invite the user in question and the community to provide their thoughts as well.


2 days ago this question was asked. As you can see from the revision history the code was cluttered with so many comments that half of all lines were just comments. I removed all the comments while also fixing the remaining issues.

In the comments I left a note that all these comments weren't necessary. He disagreed with me on that point after which I left a final comment referring to Meta if he wishes to discuss it (paraphrasing, refer to the original question for exact words).

Today a new question was posted and by the style of the comments I immediatly recognized it as the same user. I already fixed the question once and left feedback; I wasn't going to fix it again. For this reason I simply left a comment asking to remove the unnecessar

  • If there is a policy to be cited here, it is this:

    In any edit war, the OP gets preferential treatment.

    Editing other users' code in questions (including code comments) is strongly discouraged.

    There's no standing policy that says question posters are required to edit out spurious comments or make their comments relevant, although there's certainly nothing irrelevant about these comments.

    Where you see this:

    /* *

    * This class instantiates CO2 Electricity Emission objects with five private instance variables.

    * It contains three mutator methods: one to calculate the average annual electricity bill, another

    * for average annual price of electricity, and the annual home CO2 emission from electricity.

    * Private instance variables include monthBillAverage, monthPriceAverage, annualCO2emission,

    * emissionFactor, and months


    * @author A. Mackey

    * @version 01/04/13


    import java.util.ArrayList; //import the ArrayList class

    public class

    5 days ago
  • It Happens

    I think we've all kind of dealt with this issue or an issue like it before. It's usually newer users who haven't quite gotten the grasp that the people correcting them have the reputation they have because they've been around to understand the common practices of the site. Nevertheless, enough people will eventually tell them to stop doing something or do something that they haven't been doing. Eventually this user in particular will see enough of those awful "For better help next time, post an SSCCE" comments.

    Don't Fight

    The important thing is to not get in a "Rollback War". Those get messy but they have created methods to stop these.

    The First Point

    The point is, take the unnecessary garbage out of your code before you post. Yes, you'll have users who WILL wade through it to find your issue, but at the end of the day, you are getting free help for programming issues, comply with the suggestions of the community.

    The Second Point

    A man convinced against his wi

    5 days ago
  • If you're going to SOLVE his PROBLEM do so in the SOLUTION area provided at the bottom of each post. This allows you to clean up the formatting, remove the comments, and allow others following along to see the poorly formatted (and therefore harboring potential ills in the comment blocks) and the cleanly formatted.

    Additionally, where you see waste, some people see "stub for documentation" and "corporate policy" and "good practice". So don't diss on everyone else's coding style for not being yours. Mind you, I prefer the 1TBS and at my company we use a modified Allman. I don't go around berating them for how dumb it is to have extra braces and newlines everywhere, but then again I am rabid about

    if(condition) { <----- use this effing brace


    } <----- use this effing brace

    when my coworkers prefer this style:



    Guess how many fights I and my coworkers get into about braces and 1TBS vs Allman?

    If you guessed "0" you're right.


    5 days ago
  • One important thing nobody seems to have pointed out is that there is a difference between 'too many comments in code' and 'too many comments in code in a question'.

    It's implicit in your question (I think), but calling it out explicitly might have helped to avoid getting into a war of religion.

    Taking it back to first principles:

    What is the aim of Stack Overflow? Getting answers to my programming questions.

    What is the best way to get an answer? Make my question as easy as possible to parse - for easy also read quick.

    Robert is right that you can mentally parse out comments (if you want), but I suspect that some users (as Lance Roberts says) will see 'no effort' and move on.

    In that respect, if your quote of the OP as saying "it's too much work" is accurate, I'd say let him stew. It's his question, let him do the work. If he can get an answer without, good for him.


    The comments can be relevant to the code, but not to the question (and vice versa). It's a judgemen

    5 days ago
  • It's not our business to tell our users not to comment their code, and it's not meta's business to settle a debate over comments in code or get someone to change their code philosophy.

    If they have excessive comments, the idea that they're "excessive" is a matter of your own opinion. Apparently they like to program that way, and that's fine. You should probably not try to convince other users to program the way you want to program.

    If they have incorrect comments, that's a very informative part of their question and possibly even part of the problem - they might misunderstand their own code, or they might just be working on outdated information. You might want to point this out whilst you provide a valid answer to their question.

    In this case, readability isn't really affected, so that's not an issue.

    5 days ago