Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

27
  • 25
    @findusl I've read Uncle Bob. In principle I agree with him. His primary point is that comments shouldn't repeat what the code already says, and that is absolutely right. He does lean on it too hard though, and the message that tends to get through (as the OP has misunderstood it) is just "comments bad". In that, I think the way he's put it across is actively harmful and damaging to good software engineering, yes. He's coming to it from a PoV of improving practise for existing skilled coders who can tell when they're needed, and this is too easily misunderstood by newbies who can't. Commented Feb 6, 2020 at 10:59
  • 14
    @findusl ... His summary on comments is "Use as explanation of intent; Use as clarification of code; Use as warning of consequences." and that's absolutely right. But that gets masked by statements like "every comment represents a failure to make the code self explanatory". I would like to say that last statement is not even wrong, but really it's wronger than wrong because he knows better. Commented Feb 6, 2020 at 11:07
  • 11
    @findusl ... This blog post for example shows him giving an example of how they're needed, because the code cannot capture it. If you asked him if he thought that piece of code was a failure, of course he'd say it wasn't. But when he says "every comment represents a failure", that's exactly what he's saying about other people's code. That is clearly, demonstrably, wrong by his own admission, and Robert Martin in my eyes is a less competent authority for making that statement. Commented Feb 6, 2020 at 11:09
  • 10
    @findusl: You should be wary of anyone who spreads dogmas about programming as if they were absolute truths, especially when it's apparently those people's business model to publish a lot of books which seem to attract readers with their promise to reduce an exceedingly complex and heterogeneous engineering discipline like software development into a set of easily observable commandments. Commented Feb 6, 2020 at 12:23
  • 17
    @findusl That's precisely the attitude I disagree with. Back in the day, "real programmers" wrote code without comments, and no-one could understand what the hell was going on. There was significant work done to put software engineering on a professional level, and one part of that was to get engineers to add comments which embedded documentation into the code. Using comments to explain something which code cannot explain is NEVER a failure on any level. In suggesting that it is, I believe he is actively damaging the profession of software engineering and the skills of his students. Commented Feb 6, 2020 at 12:36