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
-
pajaja17337yI think it's fairly common. Some of them don't know what to write so they just explain obvious functions, some of them start and then lose concentration when 'harder' (thinking required) stuff comes along. And then there's this fucker:
-
pajaja17337yFailed to upload image, can't edit after 5min so here's my example of 'useful' comment
-
Start of project: You know what, I'm gonna fill this with documentation, examples, and comments!
Middle of project: Well, we don't need a comment for EVERYTHING...
End of project: What does this function do again? -
My teacher was like that in college, when he said comment everything he wasn't joking, he literally commented every peice of code in the end you could bearly understand or see the code itself.
-
Salmakis6737yMy code looks like that sometimes, if i do new stuff, that ive not done before then i often write the comments before o Code, like planning the stuff. Haha
-
@Salmakis Yeah, I did that all the time when I first started programming, trying to remember all the basic functions.
-
NightGenie is correct. Plus, code should be self explaning by naming variables right. And comments are a second copy of code so they are redundant
-
Salmakis6737y@Lensflare it depends, sometimes frameworks, Interfaces and stuff we use are just not so well named as theyr should be. A small coment that just tells whats going on can make it more easy to understand for strangers
-
zshh38537yThat's so stupid. Not only does it clutter the code making it less readable it's duplicating knowledge which is never a good idea in coding.
When, not if but WHEN, you change the code but forget to change the comments you will have a comment that is lying. So in the future you might spend a lot of time investigating this comment and wondering why the code is not doing as the comment says. Eventually you find out the comment is a lie and voila - you have spent two hours on achieving NOT A SINGLE FUCKING THING!
Tell your idiot co-worker he/she is making life harder for his/her colleagues and should stop immediately. -
stacked26797y@simeg you're absolutely right about wrong/obsolete comments, and in fact this happens all the time with him
-
othersirate0213d@digitaldina The person reviewing my code always removes the comments I put to it, claiming that "we don't need that" 😮.
Anybody else here has a coworker who insists on having comments everywhere and writes code like this?
// Get foo
foo = getFoo();
// Check if foo is greater than bar
if (foo > bar)
Or is it just me?
undefined
useless comments