0
  1. What's wrong with comments that explain complex code?

    after writing a complex piece of code written in a partly human-readable programming language, why not add a descriptive and concise comment explaining the operation of the code in friendly and understandable English? ...What's wrong with explaining complicated code with a comment?

  2. Forcing people to read and understand code instead of using comments, function summaries and debuggers?

    Is the approach of avoiding commenting code to make people actually read the code and understand what is going on make sense in a medium-sized coding environment (one that can be reasonably read in whole by every person working on it within a month or two), or is it a recipe for a long-term disaster? What are the advantages and disadvantages of the approach?

At a first glance, above questions look quite similar to me. First looks like asking something like "what's wrong with following <particular approach>", while second asks "is it okay to abstain of following <particular approach>".

But both questions are somewhat broad and verbose and I am not fully certain that I figured the similarity correctly. Would appreciate an explanation if I miss some substantial difference between these questions.

1 Answer 1

3

The first is saying the OP has seen people suggestions that comments are bad and should not be used, and are asking if that really is true or not for specific scenarios, and why or why not.

To highlight the important bit

Is it really that bad to explain a complex algorithm with a few lines of comments about it's general operation? What's wrong with explaining complicated code with a comment?

The second link is all about the standard that you should not write comments in code in order to enforce a specific kind of code quality. The user is specifically asking why or why wouldn't this standard be a good idea to implement in a specific environment size.

To highlight the main bit:

Is the approach of avoiding commenting code [...] make sense in a medium-sized coding environment? What are the advantages and disadvantages of the approach?

These questions are very similar, however I would not count them the same.


I am assuming you are asking because you want to close them as a duplicate. And since the second is already closed as a duplicate, I am assuming you want to close the first as a duplicate to the second.

I would not personally.

Not only do I view them as separate questions, but also I find it extremely annoying when I come across cases where question A get closed as a duplicate to question B because they are similar (but not identical), then question B gets closed as a duplicate to question C because they are similar (but not identical), however question C does not answer question A. The end result is when I want an answer to question A, I get question C which does not answer my question.

Add a link between them since someone seeking the answer from one would be likely interested in the answers of the other(s), but don't close as duplicates.

1
  • that's a good food for thought, thank you! I only want to note that since questions were brought to meta, their current close status doesn't matter much. Say, if there was a strong meta agreement that second question should be dupe of the first, it could be simply flagged for moderator attention with the reference to meta discussion and request to take care of this (for moderators, re-opening / re-closing is technically easy)
    – gnat
    Sep 6, 2014 at 19:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .