9
Cysh
7y

Work rant :

I once had a code review and remembered I forgot to comment my code and said sorry I forgot to comment it out.

The reply I got?
Don't worry, here we say your code should be readable enough and no comments are required.

Im still amazed, like... Even if the code is readable, fuck this I need a tl;Dr comment for the long ass fucking code... What the fuck

Comments
  • 4
    I actually dont write comments, except for doc comments in the public api. usually if you split your code in methods of 10-15 lines you rarely need comments.
  • 3
    @gitreflog true, but it would be nice when I'm replacing a guy on maintenance to have comments explaining the purpose of a class with an explanation, or at least some architectual docs
  • 2
    As someone on here once said "Comments lie, code doesn't"
  • 1
    @Cysh "except doc comments for the public API" I agree wirh you on that one.
  • 1
    Code can't explain why you are doing something, only what you are doing. Comments should be explaining the "why". Plus I disagree with the idea that code can't lie. If the comment says X and the code says Y, it's not necessarily the comment that's wrong. Sometimes it's a hint that the code is off-spec/bugged.
Add Comment