Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
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.
-
Cysh1476y@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
-
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.
Related Rants
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
rant
code review
workplace
work
wtf