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
Search - "#comments"
-
Announcing a few new devRant Android/iOS features, available immediately in the latest versions of the devRant app which just went live.
1. As pictured, you can now easily scroll to the bottom of any long rant by selecting “scroll to bottom” in the ... menu of any rant with >= 10 comments.
2. At the bottom of any rant that has at least 1 comment, you’ll now see a button that allows you to refresh the rant (and scrolls to the bottom) so you can see new comments if there are any.
3. Any rant can be refreshed by tapping the “Rant” title in the title bar.
How did we come up with these awesome ideas/decide to add these features? For most of them, we didn’t! At least 2 of these were recently requested by devRant users (some requested a bunch of times) and we heard everyone and saw how much these were needed. Remember, you can always suggested features in our GitHub issue tracker: https://github.com/devRant/devRant - we always appreciate feature suggestions and ideas for improvements!
Just to add one note - we still have plans to improve commenting functionality, but we’re hoping for the time being these additions make things a little more intuitive.
Let me know if you have any questions, and thanks everyone!22 -
Had a PR blocked yesterday. Oh god, have I introduced a memory leak? Have I not added unit tests? Is there a bug? What horrible thing have I unknowingly done?
... added comments to some code.
Yep apparently “our code needs to be readable without comments, please remove them”.
Time to move on, no signs of intelligent life here.39 -
Shout out to devs who put comments in your code I'm so done with my team rn
Also we have slack for a reason stop texting me to update everyone on changes...2 -
I sometimes write code by first putting comments and then writing the code.
Example
#fetch data
#apply optimization
#send data back to server
Then i put the code in-between the comments so that i can understand the flow.
Anyone else has this habit?18 -
After opening the legacy code and finding out that the entire shit has 15000+ LOC and without proper commentsundefined devrant please help fbi fucking comment the code properly comments thensa legacy code notnsa devil wk58 god3
-
Writes program.
Doesn't comment code.
*Yeah totally gonna remember everything* 🕶
*5 weeks later*
what the heck was I writing.? 🙄😥😭7 -
Just downloaded some big ass codebase and the first line i read is:
"// The source code is not well documented, but every advanced programmer will be able to understand it after some time."
Well... let's find out about your definition of "some time", Dickhead!3 -
Shouldn't be necessary if you just write understandable code xD..... Some people just write stories in between 2 lines of code....15
-
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?22 -
I hate myself. Really.
Last week I wrote a function to handle file uploads and at some point I left this very useful comment.
Do I know what to fix? Absolutely fucking nope.
I want to punch me from last week in the face9 -
Me: So, I've been looking through the code and there's barely any comments and documentation. What's up with that?
Him: Yeah, it's really complex and low level, so it's difficult to actually describe what it does.
Me: But that's exactly why you should document it! 🤦🤦🤦
Him: ...3 -
The proper use of comments is to compensate for our failure to express ourself in code.
Quote of the book "Clean Code" by "Uncle Bob".
#ShotsFired6 -
"A common fallacy is to assume authors of incomprehensible code will be able to express themselves clearly in comments" -Kevlin Henney1
-
Another stack overflow rant.
I had a disagreement with a self proclaimed "high repper" last night. We exchanged words in the comments of one of my questions.
Later (about ten mins) i see that another one of my questions has been closed and marked as duplicate - by this same fuck-knuckle. He has obviously gone to my profile and then gone out of his way to harass / bully me by doing this.
The 2 questions are absolutely not duplicates and he has marked them as identical.
I go to his profile and his headline thing is
"Low reppers hate closers but they need to go bitch about it elsewhere"
If anyone on here doesn't understand why SO gets a bad rap, it's specifically due to complete cunts like this guy.
If you happen to be on here and recognise yourself from the really cringy "low reppers" comment on your profile, then all I have to say to you is that you are a complete an utter ballbag; a tool; an arsehole of the highest order.
Fuck you and all your spawn.10 -
This is how most comments in code are. Why are you telling me it's a coffee cup, I can fucking see it's a coffee cup, who owns it and why is it right here? Are you putting coffee in it or something else?6
-
Sometimes I go ridiculously hardball on my comments in order to gain a better understanding of what I'm trying to accomplish2
-
Our PM found a contractor, results as expected..
Contractor: "The file you supplied is corrupt, some areas are greyed out and damaged"
Me: "😐, do you mean the comments?"
Contractor: "I'm not sure what you mean 'the comments'"
Me: "Does the file work as expected?"
Contractor: "Yes"
Me: "Strange! I'll have a chat with our PM and get this issue resolved right away 😉"
...
if(!contractor) {
return Promise.resolve()
}1 -
If you're gonna comment a lot or a little, at least be consistent. I just read some code like this:
//prints "are you ready?"
printf("are you ready?");
//get the value
int findVal(int x) {
/* some fucking complex algorithm with no comments whatsoever that seems to have an error messing everything up */
}10 -
I worked with this guy at a startup one time, and just to annoy me, he would write commit comments describing how I was such a bad developer, or how I was such a horrible person. After like the 15th time he did this, I decided to be totally unprofessional and do the same for him... our commit comments quickly turned into a conversation where we would just insult each other (as a joke).
The original developers of the startup no longer work there (including me and him)... I wonder who's reading those comments now.3 -
Hi guys,
I did disappear à long time, you know personal problems...
But I'm back to work now, and I was watching cppcon, when...7 -
I am sure this has happened to all of us in some extent with some variations.
Colleague not writing comments on code.
Ask him something like "How am I suppose understand that piece of garbage you have written when there is no comments or documentation?"
This keeps happening for a long time. Some time after, I write a kernel module using idiomatic C and ASM blocks for optimizations (for some RTOS) and purposely not write neither documentation nor comments.
When he asked for an explanation, I answered to everything he questioned as general as I could for "that trivial piece of code".
After that he always documents his code!
Win! 🏆4 -
I just finish "rebuilding" a page that I have built last year. My Js file (jQuery) went from 1200+ lines to 600..
I rewrite everything, the functionality is the same but the code is mush more cleaner.
Soo bad and redundant code.
Although comments where very helpful.
Feels good. -
my own program is confusing me :)
it'll be fun waking up tomorrow trying to solve a hard problem…
oh shit i forgot to add comments🙃2 -
Fuck the way comments work in xml. I want to write a 2 word comment but before that I apparently have to make an ascii art mona lisa. Infront of and after the comment.5
-
Add no comments or documentations whatsoever during my initial years of coding (when actually I used to write code worse than a constipated elephant's shit).. In my mind I would be like "This is quite clear-cut.. A first grader will be able to understand this code.."
But then I had to debug my own code barely some 1-2 months later and I figured out the importance of good comments and documentation..3 -
Comments should describe the why and not the what and always be up to date ... or this will be the result.2
-
Inherited project from another company that the owner wants updated rather than rebuilt.
The comments could write a programmers joke book as you can tell it's been passed between multiple developers.
This is a literal excerpt
//Not sure why this line needs to be here but it breaks without it
//Nope I don't know either
//FFS now I have to deal with this. Thanks guys :/2 -
literally lol'd out loud when I saw this. Found in the source of popular event loop library libev, in ev.c line 214:2
-
A list of hilarious comment in code:
http://stackoverflow.com/questions/...
One that I liked in particular:2 -
So my co-worker loves to tell us to comment our code, for obvious reasons.
But now I'm debugging his code, and guess what.
No comments.
Okay, maybe two comments in two different queries, but they were not that helpfull.
So now I have to debug his code, and I have no idea what I'm even supposed to look for!10 -
Quick'n'dirty devrant filter for tampermonkey (frontpage, comments, mentions in comments, notifs), since there's no block/ignore function, bye to whoever lands on that 👋3
-
Please remember that comments in html do not start with //. This comes from the website of one of the most important gas and electricity distributor in Italy btw...2
-
Me: Can you do the javadocs comments
Coworker: I've never done that, *looks for it on google*, I can't do it, I don't know how.
Me: Did no one asked you to comment you code at school?
Coworker: Yeah, but only the ones with '//'
Me: Ok, bring me coffee1 -
I have a coworker who comments every line of code he writes and it doesn't matter how simple the code is and it drives me crazy when I have to look at it. A real life example:
// Gets the total length of the server name string
var total = serverName.length;7 -
There are still old youtube comments from my younger self to be found on youtube. Delete every evidence!2
-
It would seem that my most witty comments don't get as many ++ as the simple comments do.
Disappointing.14 -
Don't you hate it when you come across a old internet argument but one of the people deleted all of their posts so now you just see a bunch of out of context replies.3
-
In order for the program to run smoothly, it is often necessary to add some comments to the code comments...
/***
* ░░░░░░░░░░░░░░░░░░░░░░▄░░
* ░░░░░░░░░▐█░░░░░░░░░▄▀▒▌░
* ░░░░░░░░▐▀▒█░░░░░░▄▀▒▒▒▐
* ░░░░░░░▐▄▀▒▒▀▀▀▄▄▀▒▒▒▒▒▐
* ░░░░░▄▄▀▒░▒▒▒▒▒▒▒█▒▒▄█▒▐
* ░░░▄▀▒▒▒░░░▒▒▒░░▒▒▀██▀▒▌
* ░░▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▀▄▒▒
* ░░▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒█▒▐
* ░▐░░░▒▒▒▒▒▒▒▒▌██▀▒▒░▒▒▀▄
* ░▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░▒▒▒▒
* ▀▒▀▐▄█▄█▌▄░▀▒▒░░░░░░▒▒▒
*/9 -
Friend - could you comment your code, so I can review it pls.
Me - *comments "gets shit done" ,
"Does some shit ",
"I really don't like commenting my code "4 -
The codebase I'm working with hss rarely comments on it. But when there are comments written they are shit like:
//Kill Matt
//don't ask me where that hard-coded value came from, it just works
//we have to add the elements to the fucking list
Reeeeally helpful. Yep.2 -
“Good comments explain why, not what,” says Andy Marks. “Do more of the former and none of the latter. A well named method or variable will beat a well-written comment every day.”2
-
Code reviewer keeps removing my comments saying, "This will only be read by other programmers, the code should speak for itself".
<hyperbole>
This is the exact opposite to back in uni where for every line of code they demanded 2 lines of comments!
</hyperbole>9 -
gotta love them comments:
#TODO: move this,
#TODO: deprecated,
#TODO: fix this,
#TODO: DON'T DO THIS,
#TODO: refactor,
#TODO: CHANGE THIS
I shit you not6 -
I (don't) like how some people say "If your code needs comments, your code is probably ugly and should be rewritten".
Well, asshats. You have never considered complex calculations/functions or "temporary" workarounds, right?
Sometimes, you have to do it in a not-very-readable way for efficiency. There is no way around that in that case, and comments that either explain the code below or provide alternative, slower code that's commented really help others understand your code.
If I ever work with you and you don't bother commenting your code at all (or rather use slow code because more efficient code doesn't appeal to your "muh code dun need comments" approach), I will hate you.6 -
Haven't coded for a few days, returned to my github project to find one of my co-workers has gone through every single line in all of the scripts and added passive-agrresivd, sarcastic, comments about what they do.
Thanks.... I guess....5 -
/*Why this website does not use slashes to the front of all the comments on a rant is beyond me!*/4
-
Code comments #1: A way to document bad code that wasn't reduced to it's essentials and thus unreadable. Bad.
Code comments #2: A way to explain for non-programmers how the code works. Wrong place.
Code comments #3: Company policy. No one really knows why, but others do that, so we better do it to. The management sucks.
Code comments #4: Because some hip methodology/guru describes how to document code. After a few years, when the methodology has been (unofficially) forgotten, everyone still comments the code the same way. The old management sucked.
Code comments 5#: For insecure programmers who want to convince them self they understand the code they've written. Maybe apply at McDo?
Code comments #6: Some programmers are apparently paid by lines of code. Possibly understandable.
// Comments, anyone?8 -
How to disable "New comments on a rant you commented on!" notifs?
As a true narcisist, We are not interested in people's comments as long as they aren't praising Us and Our ingenious words. As all comments mentioning Us are also praising Us, only showing notifications for comments that mention Us would be fine.9 -
Back then when I was working on a website logic, I didn't want to comment my code. Despite that, I wrote some things which were obvious and I thought it would be funny to explain obvious things in code. I made a joke out of commenting.
Recently I needed to use a part of the code for a different project and the comments were exceptionally helpful and I would be lost without it.
So, kids, comment your code!14 -
I Remember what my senior told me once:
"You know you're in the wrong job when you see source code filled with comments written by ur senior dev scolding other devs for code fuckups" -
"There are only two hard things in Computer Science: cache invalidation, naming things, and off-by-one errors."
-
I let my programming buddy comment all the code I write. He's great. His comments looks like this:
/*
I am groot!
*/1 -
What if we fed all rants and comments on devRant to a neural network trained to write rants and comments on others?10
-
Maintaining old code as comments, coz... you never know when that bug in your commented code turns out to be the next big feature.5
-
Start-up I'm working for as a front-end dev is pretty nice. I have good hardware, free coffee and my coworkers are all decent people. My boss is chill, and I have flexible work hours.
There is this one policy for writing code, however. And I simply cannot understand it, nor can I ignore it because of code reviews: no comments in production code.
I mean, what? Why? Comments are nice, and they make life easier for the future maintainers. At least let me put a small two-liner explaining why I did stuff this or that way. But no, I only get to explain it verbally (once) to the person reviewing my PR. Why, man?9 -
I have always believed that clean code is readable code, and if your code is readable, then it shouldn't require masses of comments to explain it. However, in the course I am being taught, we are being told that in programming, comments are massively important to help another developer understand your code and what it does. So what is the consensus of the dev community?
Do you feel comments are key, or redundant if your code is written well?20 -
The student assistant gave me a half point penalty for writing down to much comments! Direct translation:
To much of this kind of comments is not needed, the code itself is clear on its own.12 -
I just took over a new project from a brand new client today. It's an Android app that he said needed some updates and refactoring, and he said it wasn't well documented but he would add some comments for me before giving me the code. He gave me access to the code today and one class in it is over 1200 lines long with exactly 4 methods in it... the shortest method is still over 200 lines long. There is one comment at the very top:
// Needs refactored.
... gee thanks.2 -
Some people seem to dislike Stack Overflow, but I remember it from the time when it was much funnier. In those days I, for some reason, thought the web is a scam(free _correct_ answers? kiddin' right?).
Here you have some pearls from comments and even code. It's worth reading! ^^
http://stackoverflow.com/q/184618/...1 -
I'm the most ignored user of devrant regarding last week. Can you believe it? These stats summarize the amount of times that a message is not upvoted. It doesn't count mention's tho. A lot of people do not upvote if they mention. For more heartbreaking stats, see comments.
Also, poor GPT, always directly asked but one of the least appreciated by upvotes59 -
Let's try this.
In the project I'm working there is an strict rule : NO COMMENTS!!!
I mean wth, the times I've spend hours trying to understand the crappy legacy code in VB.Net that has been there almost decades, that wouldn't happen with comments, I know i know there are some supernatural developers that think in binary and their eyes work as compilers, but I'm not like that, so seriously go to hell.
P.S. Of course I follow that rule, after all, my code is so damn perfect that even a baby can understand it.
jkundefined devops etiquette stupidest pichardo for president stupid stupider stupid stuff jk rant code smells comments3 -
HOW. IN THE WORLD. COULD IT BE SO DIFFICULT TO COMMENT THE CODE I WRITE MYSELF ?
After my first project (you know, the "Working project I made for fun long ago" code everyone did once, but when you look at it again it looks like sorcery and there's no way to understand it ?), I decided that I'd comment almost everything I'd do... But...
When I begin a project, it's fiiiine and I do my comments the way they should be... AND THEN, WHEN DIFFICULTIES ARRIVES AND I START TO BE TIRED (ie : always) THEY START TO INCLUDE INSULTS OR WEIRD JOKES ABOUT THE PROGRAMMING LANGUAGE, MOVIES REFERENCES, AND SOMETIMES THEIR LANGUAGE VARIES. (Like, that project you're doing in English and suddenly there's a comment written in French in the middle of that)
Soo, yeah, even if I do comment my shit now, it isn't more helpful, lol. Maybe I should listen to relaxing music when I code err.
Oh, comments. Damn comments. Someday I'll do those correctly. Maybe.8 -
*Pro tip:* add comments in your code stating what you're gonna write next! This helps the reader to know what to expect!
[filename EventsTable.js]15 -
So, Instagram put that "Be the first to comment" as a part of the background on the image itself. Whenever I scroll past comments that is visible in between the gaps. They couldn't even render a simple text view if there are no comments. And, I thought I was the only one who uses lazy hacks to make things work.2
-
OK people, I don't need a novel written for every line of code, but PLEASE STOP trying to tell me that "yOuR coDe sHouLd bE sELf dOcUmeNtiNg aNd cOmMenTs mEaN iT's aUtoMaTiCaLLy bAd". That's a bunch of BS. I can't begin to tell you how many times I've saved my own butt by dropping a "this call can't be awaited; causes the library's internal API to throw an error" comment in my C#, or a "can't use double quotes here; doesn't work right for some reason" line in my JavaScript. Sometimes there are very good but un-obvious reasons why something was done a certain way, even though it looks like it could be done better. And don't try to tell me "the tests will catch it". Let's be realistic here, nobody has 100% test coverage on any project that's much more than "Hello World". And even if the tests DID catch it, why waste the time when you could just write a comment?
P.S.: This is not directed at anyone on here specifically. It's directed at all the devs I've met IRL and the comments I've seen on SO, who think that comments must be bad.12 -
Every language that doesn't have multi-line comments:
# Of course CodeLang supports multi-line comments!
# This is a multi-line comment!
# How dare you say otherwise!13 -
Why the heck would you allow (or need) nested block comments? Imo this is a major design flaw in the kotlin linter.
I always use /*... //*/ so I can remove the comment starter w/o having to remove the comment end, but kotlin just starts a second, nested comment there.
Java, C, Cpp, C#, JS,... Not one of these uses nested block comments. I think jetbrains was just lazy?
I mean, I know why such stuff happens. I also developed DSLs in MPS, but there sure are ways to go around such things..7 -
The devRant gods got me puzzled again
The api for voting posts is
*/devrant/rants/id/vote/*
But for comments is
*/comments/id/vote/*5 -
That moment during your internship when you work on a project using a framework you're not familiar with, with no doc, and absolutely no comments, and you find a file with 1.3k lines of code without the ability to contact the previous dev4
-
Do you agree?
Junior: What are comments
Mid-level: Hah! My code is so clean, I don't NEED comments!
Senior: comments comments comments comments comments comments comments comments comments comments comments comments comme-...25 -
!rant
Having lots shitty comments and lots of shitty rants is like having passive income, the ++ come slowly but surely. -
Download an open source project and look for code comments to get my understanding... Nothing but 'todos' here and 'todos' there
-
When a user deletes a comment, it would be more ideal if the comment was tagged *deleted rather than entirely removing it. Sometimes this makes other people's comment sound out of context whereas they where referring to a previously existing comment.25
-
/* Spending time writing comments in code because if everything else fails, at least I can write a novel depicting a deteriorating struggle to make up my mind from them */
-
So I did a code review for a colleagues pull request and I've noticed that he hasn't written the PHPDocs for a lot of the classes and functions. One minor thing I wrote is to add the author for the class.
About 2 mins after writing that comment he came over to tell me why should he write the author in the comments when people can just go look at the git commit logs. I was like WTF? I asked why would he do that, his answer was that if there's an issue, we can just use git blame to identify the author. To me that makes no sense as git blame isn't supposed to be used like that.
It's guys like these are the ones who don't document anything whether in an online document or even in code. And they just make work harder for the rest of us.2 -
What's your opinion on leaving funny notes in comments from time to time? Is it highly unprofessional or you don't mind them if they are sparse?
I found this on GitHub jebej/Schrodinger.jl7 -
Dear last dev, thanks 4 leaving little 2 no //comments as u possibly could. 😑😣😢😠
Please //comment ur code!!1 -
Just realized that the scroll position indicator dances when scrolling through a long list of comments 😄, and I think that's beautiful1
-
int i = 0; // i is an integer initialized to 0
wtf?!?!?
comments should explain why not how or what the code is doing...1 -
That feeling when you're finally done with a pretty big PR and ready to go live. You excitedly send it out to a few of your peers, and then... 20 comments! The real work has just begun 😭1
-
Awful idea of the day - Have a programming language with no comments, but regex preprocessor macros. Use macros to define your own comment syntax and strip them before compiling.
#define /\/\/.*//1 -
Code doesnt work, i dont know why
*comments then uncomments same line*
Code works, stilll dont know why2 -
I am glad that I usually include comments, which make me smile years later...
What are your best findings when you look at your old code?
something like:
// having any and all at the same hierarchy is not valid (and stupid)
someMistakeDeep: 1 // deep fail
// TODO: find out, why the cache is behaving like this. And fix it ¯\_(ツ)_/¯
or my all time favorite comments
// this should not happen.
// wat?
or testing emails like
- tldsAreNotCheckedBTW@something.idontthinkthisdoesexist
- nonValidEmail.com
or urls...
- ProtocolMissing.com
- www.stillNoProtocol.com
And when I'm out of ideas, something like this
messageContent: 'Bla Bla Bla. Exception in FS on Host https://w.com/hpsa',
{ SmsVerb: 'randomVerb' }, // unknown Attribute5 -
When Google (or other companies) make AI that makes another AI or code does the original AI write comments?4
-
If you have any project (personal or not, doesn't matter) that does not have proper code comments and documentation and you don't want to make one because of the effort (maybe even "wasted" effort), think again. When commenting on a wall of code to say what it does, you may find a better way of doing what you have to do, possibly increasing performance, or improving security.
I have been able to do better input sanitization for a method on a personal project of mine because of this.
Don't use the amount of effort for proper documentation as an excuse not to make one.2 -
At the risk of starting a war, what are folks opinions on in-line comments?
Personally, I'm against them. Self documenting code for the what, SCM for the why.
Comments can get out of date if not maintained; code cannot lie.9 -
"Multiline strings can be used as block comments in Python." Except in some places, where your code will pretty much blow up without any errors, because instead of commenting out a portion of an array, you've just added one big string element. And there's no other way to make block comments. And after actually commenting out every single line, your version control won't know how to merge it anymore, because there are now 100 changed lines instead of 2.6
-
Not sure if anyone appreciates but here are the new dR stats!
For more stats see comments.
Do you want to have your personal stats? Ask me, it's already generated. I only have to post it.27 -
COMMENTS BE LIKE...
Physics exam. Seems I was the special guy who did the task in a different (and almost correct way), so my teacher had to share some golden thoughts with me.
Passed anyway xD6 -
So I fix a bug and I create a PR, someone reviews it and leaves a couple of comments, I address those comments and push up my updated code thinking “great I should be ok to move onto this big story waiting for me”
Then some Expletive.random(); from a totally different team who has no context of my change comes in and starts leaving petty comments. He literally pointed out 3 different things that could be made private/package-private.
Bugger off and focus on your own team’s work instead of leaving comments about relatively trivial things on my PRs.
Apparently he is well known for this. I can tell we are gonna have some fun encounters...1 -
It turns out 1200+ comments on a rant breaks devRant, I can't load the comments section anymore without the app crashing.
https://devrant.com/rants/2420819/...
On a other note, where did the block feature go?6 -
Picking up some uncomment code:
var_dump() and console.log() everywhere
1h later: shit I think I lost it again...
2h later: It was a 2-3 lines fix..
fml1 -
RaspberryPI Lego
This is CRIMINAL, how can you make
something so COOL and not put links
to where I can buy or make it myself?!
And the comments are turned off too?!
https://youtube.com/watch/...3 -
Me: I'll comment that later
Also me: Why tf isn't there any comment
No seriously, comments and documentations are really necessary. Today I've been debugging for hours, why a certain variable has a certain value. Age of code: 15+ years. No comments. No docs. 🙃5 -
Why commenting is important?
If you are commenting a variable or method and you can't find the right way of explaining it, there's a problem with your code6 -
I saw this piece of code, one of my colleagues at work wrote it.
The content in in the function also had 0 comments.
Sorry for posting this here co-worker but it sincerely bothered me.
// Delete all
function deleteAllFunction(){
...
}6 -
"The call to the tracking was removed by the previous developer months ago" the eccom manager thought......4
-
One advice I've given to most junior developers which they've practically benefited from is...
"Avoid duplicate comments between interfaces and their base class at all times".
As a smartly-lazy dev, you shouldn't enjoy writing same thing multiple times... be it code or comment, don't write it twice!2 -
I've finally got into the habit of writing descriptive comments in my code. I've always just got so into the coding and comment later when I don't know what the code does anymore xD1
-
Hilarious comments check it out on the cancer (stackoverflow.com) 😂
https://stackoverflow.com/questions... -
!rant
In my team, I am not allowed to use ANY comments except for the really lengthy classes in the backend.
Thus, the code of the whole project (a complex webapp, consisting of 20-something Django projects and various services) is basically undocumented.
The slogan sounds "good code doesn't need commenting".
Seriously, fuck this and all of the times I scratched my head wondering "what the fuck is this spaghetti about".
Have any of you encountered something like this? Usually people don't want to comment, I would do it gladly but can't even make a small inline about what complex method is exactly doing :P3 -
At the risk of starting a riot. What is your preference?
// space before comment text
//or jammed up next to it?
// Furthermore, do you capitalize your comments?5 -
Going back to a project from a few months ago, a fellow dev has committed 'test this' comments with my name...
Hitting up git blame shows my tests were written 2 weeks before! If you're gonna be passive aggressive, at least do it right :/ -
In CS class I had a only 10 lines long python script (everything else was commented out). It didn't work and I searched the bug for ca 20 minutes. I asked a class mate (who commented the other code out) if he could figure it out and he just says: "The indention of the comment is wrong". We had a discussion that it doesn't matter how to indent comments. In the end he selected all the lines, pressed tab and it just worked ?!?!6
-
What's worse than no comments? Outdated comments.
If you won't maintain your comments, I'd rather you don't comment at all. We are all better off for it.1 -
Writing documentation is one of those tasks that most developers don't like doing. Especially when it comes to writing in say a Word/PDF file, an online wiki, or Confluence. It's time consuming and a pain in the ass.
But even if you don't like it, at least write comments in your source code! I hate having to keep writing "Write the PHPDocs for this class/function" in every pull request that I review. It's wasting my time writing such comments when it's such a basic thing to do when writing source code.31 -
"My code is explain itself. Well, I need no comments to understand it."
I don't care if you wan't to write comments or not; If don't write any then i don't care because fuck you and your code.
May it be java, kotlin, python, javascript or anyother language, you think "everyone can read", i hope you'll never find anyone who has to deal with you and your cancerous code.joke/meme the code explains itself explain code javascript cancerous readability fuck kotlin dealing with other people comments java7 -
Bugs are good in code. It shows that you're Human. You make mistakes. And you're willing to correct them.
But when they're someone else's bugs in a piece of code they didn't give a flying fuck about documentation, bugs can tick one off. The bigger the project, the better the documentation needs to be. And I'm not taking about java docs. Put proper comments in your code. Especially when it's not a personal project and you fully intend to leave the company. -
"Sorry, but nothing in this MR is as it should be (I don't even know where to start) - all you do here is waste scarce CI resources"
Much helpful. Such wow. Teach me how to make such toxic and useless merge request comments.5 -
There is a period in developer's life when writing comments in your code is a good idea. Then, after some time, when you write comments, it means your code is not that descriptive, is not so good that you consider writing comments.2
-
I always enjoying snacking on some popcorn while people argue so, what are your thoughts:
Comments in your code - good or bad?4 -
Whoever left this code with comments like “Le JavaScript” or “Le HTML 5 Shim” I wish you immense anguish.3
-
Are there any *performance benefits* in having your users comments on a separate page rather than the actual post/article page?
Example use-case: medium.com5 -
I just lost a comment and had to rewrite it because I clicked a millimetre under the "post" button.
On new posts, the text remains in the box and can be edited the next time, but not on comments.
Perhaps I should get used to navigating to the "post" button with the tabulator key (↹).
It would be even better if CTRL+Enter did send.4 -
when my rant get more than 5 comments.
#out of memory exception#
just drop it, unfollow and let them comment.
😜5 -
Some time I just love comments that are brain twisters.
```
( [ helpers.must_not(helpers.prefix("response", "10")) ] if _type=="detractors" else [] ) )
# Above line prevents the condition 10 is 1 but 1 is not 10 making 10 is 10 and 1 is 1 and 1 is not 10
```1 -
#get unique images ids
images_ids = np.unique(images_df.index)
Dear developer who wrote the code I'm looking at,
thanks, I really need comments like this one. I was wandering lost in 1500 lines of code, looking for an explaination of what the actual fuck the code is doing, and there I see you, comment. It's not like I want to know what the hundreds of lines functions do, who cares about that. What I needed to know, what shed light on this dark forest, is what the numpy functions do, because as you certainly know dear developer, such functions are really hard to comprehend, lacking of documentation.
Thanks.2 -
Comments throughout code with things like "changed to fix bug #". And commented out code all over.
We have source control, why the hell are you doing this? -
I've always found commenting my code tedious, is it better to comment as I code or wait until its stable and then comment all in one go at the end?9
-
Feature request:
OP gets ++s for different stages of comment amount.
E.g.:
5 comments = 1++
10 comments = 2++
20 comments = 4++
40 comments = 8++
...
;)15 -
When I got at least 20 comments for a mid-sized changelist and managed to dodge/reject the suggestions provided. No questions asked further and it was committed!
-
There is ads now appearing in the comment sections of certain post .. so far I've seen one, but it's a matter of time before more appears. Is there a spam filter ?6
-
I tend to write with long variable names instead of using too many comments to explain what i am doing in the code. Is it wrong?1
-
When you are changing and updating your code update your comments/docs also, there's nothing worse than getting confused by someone else's code to find that the comments/docs are wrong
-
It is better to write almost all of the logic used in the code as comments/documentation.
Trust me.
It is a good thing. It increases Code readability.
Nobody is going to copy your logic and get hired in a high paying job or get promoted for that reason. People will come to know about your wit and will appreciate you instead.2 -
Stack Overflow question on best comment ever. My fav:
try {
} finally { // should never happen
}
http://stackoverflow.com/questions/... -
Recently took over a freelance project to update an existing app, and this thing is full of comments like "TODO: Remove This" with no context. So hard to work with.
For the love of God, add some context to your comments. Especially if someone else is going to be seeing your code. -
Two reviewers two comments on the same content, both comments conflict with each other and I'm required to apply both, how exactly?2
-
"Rants and comments can only be edited for 5 mins after they are posted."
5 mins is not fair; I think it must be at least 30 mins (or an hour).3 -
It's always nice when I get back to work on something I shelved and I find notes from Past Me anticipating my sub-goldfish memory.1
-
Once I wrote a tool to help convert alarm messages from an excel sheet into an xml file with other specific things included.
My colleague (who is very proficient at coding in his chosen system) while I was writing said tool asked why I was commenting code as it was basic!
I asked him to work out what my code was doing (it wasn't mega complex) he spent a long time googling! -
Making classes and functions without commenting what I expect each class and function to do. Which means that my classes and functions have really long names.
Example Code:
Class ReallySpecificClassToWorkWithThisFramework { ...
public void DoThisActionInTheFramework (obj TheKeyToTheWholeFunction) { ... }
} -
When Eclipse releases a powerfull Project configuration tool with not a single line of helpfull comments and I have to pleasure to add Features for my Company ....6
-
If you write comments for your functions (you should) do not use param names as param description! This is fucking useless.5
-
When people use comments for build configuration. And don't put down handy comments like "uncomment this if you want to do that".
I guess what I'm saying is that this "code cleanup" task is turning into a "code keep the bloated baseline" task.3 -
Is there any way to view my devRant post and comment history beyond the 25 last items?
The comment page on my profile only shows the 25 last comments, and nothing loads at the bottom. How to view anything older than that?7 -
!rant
Is it possible to delete your devRant account? If then, what happens to the user's rants and comments?
I am asking these because in one of my rants there are several comments of mine point @ other user's comments (that @someprick thing), but the comments I referred to are just gone.
What about the comments being there even if the user deleted his account?7 -
STOP REVIEWING MY CODE!!!! STOP WITH YOUR COMMENTS!! ANOTHER REVISION IS SUPPOSED TO ADDRESS YOUR COMMENTS, SO STOP ADDING INTO IT NOW!!!!!!!4
-
Was tasked with going over an app that my company owns to see what aspects of it we can use for our next project. So, I checkout the codebase in Android Studio, and to my surprise after going through tons of confusing classes I don't find a single comment! How am I supposed to to figure out how anything works if the previous developers didn't comment ANYTHING!
Now, I'm still fairly new to programming professionally (about 2yrs) but I've learned how beneficial comments can be.
Ugh, now I have to spend the rest of this week deciphering this code like an archaeologist inside an Egyptian pyramid. -
I just wish phone manufacturers would put the charge port on the back of the phone instead of on the sides. Don't they know everyone rests the phone on their chest in bed? It would also solve the problem of replacing knackered cables.9
-
// doesn't work.
/* nope */
<?php /* uhhh */ ?>
Only devil decided that we have to speak PHP on nearly all our comments. -
When it comes to writing comments in your code, I do quite a lot of it. Even for parts where you just need to read the code to understand what it does. However I do write very clean comments, not even snarky comments where I know someone has done something completely stupid. In my work, I generally keep it very clean. I wonder how many people write profanity, or use weird naming for functions or variables?
https://thenextweb.com/dd/2018/...3 -
Code comments are good and all, but there's a time and a place for them. They're more or less an opinionated free-form version of what code is doing.
In a library, they're good for documentation. However in a platform, it makes less sense. Especially one which is changing at quite a fast rate (though it has matured in recent months).
Dont get me wrong, we aren't doing wades of horrible, unintelligible code. We need to be sure of what happens when we call a function, so we make sure the signature is always correct.
def do_good_things(puppies): # "good things" is opinionated. Say what you're doing
"""give treats to puppies""" # doc string is wrong
pet(puppies)5 -
For those who are on my team, arguing on not putting comments in their code:
How much ever (un)readable your code is, any peer / reviewer / future team member can only understand what that code snippet is doing, but not why was it written in the first place or what the hell you were thinking while writing that logic. So, it'll be awesome if you write that as comments or at least link to the story/design doc which warranted that code.3 -
How does your organisation and team balance PR comments demanding changes and dev time?
Here, while fixing PR comments we sometimes end up wasting as much time as we took in actually developing the feature... As a result, almost every major user story overshoots the estimation and almost every sprint gets delayed.
Yes, to each his own; but talking in general, why do you think this time wasting happens?
Do you think that happens because some of us are not as experienced as the others, the existing code not being up to the mark giving a bad example, or just a skewed review process?2 -
Most of the code I write are adopted from SO answers and dev blogs, am I a terrible coder or not even one?
-
Anyone know any VScode extensions that allow you to add edit comments? Something that will allow me to highlight a piece of code, and write a comment in a text bubble. Similar to comments in the “Suggesting” mode of Google Docs