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 - "code comments"
-
Pun of the day
Boss: I heard your colleagues hate dealing with code you wrote. Why?
Me: No comment16 -
> Comments are there only for you, please delete them before pushing your code.
I want to kill everyone who suggests that, slaughter them like animals!14 -
Said my code is self explanatory and doesn't need comments.
After few minutes "wtf is this shit?".5 -
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 -
By playing with Facebook source code in browser, you can enable GIF and Markdown, Tip Jar & many more options in comments.15
-
One of the coolest good bye message I have ever seen in my company...
The code is so clean with proper comments...11 -
"Don't waste your time on writing comments or documentation, as long as the code works!" - My (Ex-) Coworker5
-
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
-
What if we developerized our proverbs?
1. A bad developer blames his tools.
2. Code speaks louder than comments.
3. Birds of a text editor flock together.51 -
I befriended a much-older dev who's notoriously known for cursing in source code comments.
His best comment was F.I.S.H., which is his cursing acronym for "fucking incredible shitty hack"6 -
Seen at work in code:
<!-- DO NOT REMOVE CONTENTS PLACED HERE //TODO: Would have loved if some one also had said why we should not remove this -->
Lol1 -
This week I've been struggling with dense, overly-complex code written long ago by someone who didn't add a lot of comments.
Hello again, past me.2 -
Stop bitching about having to write comments, they are important whether you like it or not. Trust me nobodys code is "that good" 😒4
-
I just changed a bunch of comments, log entries, and removed some blank lines from one of my controllers. Zero functional code changes. Everything worked before; now it runs only half the code, breaks, and throws strange errors.
Fucking hell.
Screw today.6 -
Other Dev left just as we hit beta and refactored all his code without documentation... Not even fucking comments...10
-
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
-
Comment the "why", not the "what". If your code needs comments to explain what it does, rewrite the code (use good, descriptive identifiers).3
-
piece of code: *not working*
me: okay, i can try this again later
me: *comments it out*
4 hours later
me: omfg why are there so many comments??? :( -
Find a great project on github=> want to find out how it works => open the source code =>zero line of comments6
-
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 -
Me : Today we have to demonstrate our progress to client. So remove all the dead code from the project which we had written for debugging.
** Removes all the comments2 -
At my previous job a coworker left positive comments alongside any negative ones on my code. “Nice job here. Very clean”, or “nice use of X design pattern here!” Kinda made me look forward to his code reviews.4
-
Why would you submit a pull request with the addition of such a comment and expect me to approve? What the hell is wrong with you?
-
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. -
Going back to put in comments after you realise your code is actually going to be used by others after all3
-
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 -
Keeping old and unused code blocks commented out and not deleting them immediately is the equivalent of leaving that bottle of soy sauce in the fridge even though you know very well that you won't use them ever again.7
-
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 -
Reading the comments in a piece of code:
{
//Step 1 save stuff in a list
code();
//Step 3 Update the controls
morecode();
//Step 4 Resize the UI
somecode();
}
//Me thinking: where the f*ck is Step 2?16 -
Why in the flying motherfuck can't people remember the fact that other people might have to read their code?! If you're not gonna name things properly, and mess everything up with utterly useless and garbage comments (all comments are useless and garbage), then the least you can do is fucking format and indent it properly!! GAWD FAKKIN' DAMNIT!!4
-
I cringe everytime I see improperly formatted code -_-
Me: *sees no spaces between function blocks so I format it myself*
Classmate: *Happily types code with no spaces between lines or comments and overwrites what I did*
Me: Seriously?!8 -
Pet peeve of the day: People littering code with comments that repeat already obvious method names.
// Submits public key password
SubmitPublicKeyPassword(string psw)
{
//...
} -
:/
Project i got to work couldn't get worse
1)Legacy code
2)mathematical model based emulation
3)no proper comments
4)deadline approaching4 -
Update log: performance improve, API rewritten, fixed all bugs reported, new features implemented, general cleanup of code, documentation and comments update
Feedback: love the new background colour!
😞3 -
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 -
Code never lies
Comments sometimes do
Nah!
Code lies too, especially when you train a neural network 😂😂 -
In order for the program to run smoothly, it is often necessary to add some comments to the code comments...
/***
* ░░░░░░░░░░░░░░░░░░░░░░▄░░
* ░░░░░░░░░▐█░░░░░░░░░▄▀▒▌░
* ░░░░░░░░▐▀▒█░░░░░░▄▀▒▒▒▐
* ░░░░░░░▐▄▀▒▒▀▀▀▄▄▀▒▒▒▒▒▐
* ░░░░░▄▄▀▒░▒▒▒▒▒▒▒█▒▒▄█▒▐
* ░░░▄▀▒▒▒░░░▒▒▒░░▒▒▀██▀▒▌
* ░░▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▀▄▒▒
* ░░▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒█▒▐
* ░▐░░░▒▒▒▒▒▒▒▒▌██▀▒▒░▒▒▀▄
* ░▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░▒▒▒▒
* ▀▒▀▐▄█▄█▌▄░▀▒▒░░░░░░▒▒▒
*/9 -
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 -
Going for my first code review. My colleagues and I will read through my main class, which is 832 lines long and a two-three comments.3
-
Found in the PCIe driver code for something I have to work with:
if (false) {
// 200 lines of unnecessary code
}
You ever heard of, you know, comments?8 -
Found my old code.
You gotta admit, that's some clean code there, considering I learned C# only for a year at that time.
But those comments....
VeRy WeLl WrItTeN, vErY dEtAiLeD, vErY gOoD8 -
I worked about two years on a browser game without using any version control. I also thought it would be nice to have absolutely no comments in the code.
-
University, Italy
We have sent our code to the professor for correction.
Professor : Who wrote the code with comments in english?
Proud student : me !
Professor : you failed to write the algorithms, and also made mistakes with a lot of English words.3 -
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 -
Email chains, screenshots shared in google docs, two comments per 1k lines of code, and sticky notes are sufficient documentation, right? RIGHT?2
-
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 -
When u send ur code for review and instead of getting comments for logic u put in, u get 10+ comments regarding variable names , extra lines and formatting.
LMF7 -
Started working on a new project.
Sent out my first code review for that repo.
An intern pinged me and blamed me that I have added so many comments to get more lines of code.
I have no words to reply him.3 -
When in internship you have to read 150000 lines of code to make changes and the code does not have any comments, no indentation, no documentation, no wiki. You'll be like fuck this shit. I'm outta here.1
-
I let my programming buddy comment all the code I write. He's great. His comments looks like this:
/*
I am groot!
*/1 -
Read code, exceptions, comments carefully. Double think before asking. But never hasitate to ask if you are stuck.
-
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" -
Hey guys, wanna see some spaghetti code? This is some parts of Yandere Simulator. More in comments6
-
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
-
Typical code life?
1. Write rough comments
2. Write more detailed comments
3. Write pseudo code
4. Write semi-working but definitely ugly code
5. Write working but very ugly code
6. Refactor the code to be nicer, check for patterns, bottlenecks and other bits and pieces
7. Push to git the "final" code
8. After few months blame whoever wrote the code
9. Refactor all the things!
---
This happened in my career more than once and still - it seems like the best option out there to get things done. What do you guys think? Should something be added/removed from this? Is this over-complicated or what?2 -
when code comments be like
# loop over the array
for i in 1...10
# divide by 2
x = i / 2
# return the result
return x4 -
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 -
Lol!
Got 8 downvotes on stackoverflow and a bunch of comments saying I have to write code before posting a question...
Bunch of naggers out there7 -
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 -
When your Project Manager tries to find Grammar and Spelling errors in your code comments, since he couldn't find any other issues
Are you fuckin kiddin me motherfucker.. :|||
Fuckin grammarShitPMNazi4 -
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 -
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 -
*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 -
Going through legacy or other developers code which don't have documentation or even comments. Plus the author of the code is not working in same organisation anymore to consult. We have to understand the code like deciphering any ancient language. 😥2
-
Last 4 days, struggling to get ship it from a Dev who is reviewing my code.
The comments have already piled up more than the LOC submitted.
The code review consists of just 2 interfaces and a pojo. Hardly 20 LOC in total, excluding javadocs.
I hope it gets ship it soon.
Wish me luck.2 -
Reviewing the code of my then new CTO, who said "I can also code and have experience in Java" - 50 lines of code, I added over 30 comments to his Pull Request. In the end, I rewrote his complete code.2
-
Finding comments in legacy code like "too tired, fuck you" or "this implementation is dirtyyyyyy" makes me wanna punch a dev.5
-
My company's process basically boils down to this:
-Hour long meeting to open an issue.
-5 lines of comments.
-Update three documents.
-5 days for a peer review.
-40 bitchy comments about how everything you do and love is terrible.
For a one line code change to prevent a show stopping exception.2 -
The moment you find an ex-colleague used code comments to take someones mobile number, then accidentally committed it. It's been there over a year!2
-
I think the best moment of writing a code is removing curses from comments and renaming variables from like "FUCKING_ITERATOR" to something more normal after everything finally works.
-
When someone copy and pastes code, repurposes it and leaves in the old comments that just confuse the hell out of the next dev.1
-
This post is now dedicated for a comment debate with the topic "Is Visual Studio Code an IDE?"
I 'll see myself out. Make the comments rain8 -
I've created a code review for merging someone else's code, coz they were signed off sick for the last month.
They're making comments about how it's wrong.
It's code they wrote, but restructured to be more readable.
They wrote incorrect code that was just so illegible they didn't realise.
How do I explain this diplomatically?10 -
Updating a legacy written by the ceo from swift 1.2 to swift 3.1
No storyboard, main controller with 2200+ lines of code and viewDidLoad method with 500+ lines of code.
Almost no comments and code is illisible.
Weeeee8 -
I have the habit of adding //todo comments to my code whenever I need to implement something later. Very useful to just search your code for "todo" and see what is left to do.
That is all very well, but I just searched my project for "todo" and there are SO MANY //todo comments in the third party dependencies...4 -
You know you need to stop debugging and sleep when you start rearranging your comments in the hope that your code will work!
-
I hate ppl who don't indent code and those who don't add proper comments to explain three crap that they've created6
-
Every developer thought what the hell my colleague is writing in code.
After watching own code after a year, who the hell is the developer.
Oops it me. No comments :) -
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 -
The best code review experience I had is when I started with my first job I used to write 10 lines of code and used to get 20 comments on that, well i learnt a lot from him and now whenever i get review comments on my PR i actually feel good.1
-
I had high ideals when I started working here. The entire code base was practically devoid of comments. Its been 5 years and it is still practically devoid of comments. I have become like them...8
-
When I started my internship my PRs got absolutely blasted by code style comments and suggestions about code that could be more optimized
Now, almost a year later, I can proudly say my PRs only get a maximum of 2 comments and I've seen myself grow over the months :)3 -
Our team had a brilliant engineer, he made a tool that would convert IBM Assembler code to C, comments included. the comments are the assembler code. bleh
-
i hate myself for having a better idea to write a procedure or a function after getting it done. *comments the first set of code, just to be sure.*1
-
/* 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 */
-
Download an open source project and look for code comments to get my understanding... Nothing but 'todos' here and 'todos' there
-
1. Wrote super complex snippet w/o comments.
2. Commit & push.
3. Read code after 1 month
4. Ask yourself how you wrote that.1 -
They say I have to learn poems to make my memory fresh.
I don't need that! I write code without comments2 -
Shit swizzler in school group project doesn't delete ANY code. Just comments out everything, everywhere.
Some of the files is scrolling through 30 lines of comments, 2 actual lines of code, 20 lines of comments, 5 lines of actual code, ...
Somewhere, in between all of his shit code, I just want to add: "Fucking stop with the comments, you wheezing bag of dicktits"
Oh and this afternoon, he asked me where he could find the Bootstrap code I'd written. He couldn't find 'the file'. I had to explain to him that it's kinda everywhere, throughout the HTML.. As a novice in many many things I fully understand not knowing everything. But the little shitstick told me he 'uses bootstrap all the time' just two hours before he asked me this.
I swear everything this guy touches turns to shit. One more day of this and I'll slap the bitch out of him.
P.S. Free virtual advocado for the first person to guess what movie inspired my insults (easy, I know)6 -
Concentrating and understanding someone's code/ script. :|
The code is not in class form, does not have comments, and indentation is out of control. T_T1 -
Code doesnt work, i dont know why
*comments then uncomments same line*
Code works, stilll dont know why2 -
Dear last dev, thanks 4 leaving little 2 no //comments as u possibly could. 😑😣😢😠
Please //comment ur code!!1 -
Feature request: Being able to copy text from rants/comments on mobile. Also some sort of code formatting would be nice!2
-
Recently graduated and in a job. Had a pull request merged with no comments or changes asked for by the code reviewer today. It's the little victories.
-
Being forced to rush code, then waiting for merge approval from your US based approver at 3am while they add comments to the review complaining variables aren't final.
-
When you look into the code of old developers with nice comments such as "What a fucking retard he is trying to book in the past". Just laught .1
-
int i = 0; // i is an integer initialized to 0
wtf?!?!?
comments should explain why not how or what the code is doing...1 -
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 -
People be like: “We don’t use comments cause good code should explain itself”
Then proceed to use complicated app architectures with classes all over the place.
Fuck.7 -
Love writing comments, hate writing documentation.
Ugh, I know it is needed but just don't care about it as much as the code/comments which is a more direct 'here is what this does' approach. Writing idiot proof documentation sucks. Any little change? Have to remember to update the docs. Yeah, not happy.1 -
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 -
the two code review personality types
review activity:
- dev A: requests code review, sets dev B and dev c (myself) as reviewers
- dev C comments: this review is marked with a complexity > 9000, touches > 20 files and has zero comments... also there's a lot of refactoring going on, making it hard for me to tell what the actual relevant changes are. can you please add more comments to this review?
- dev B (10 mins later): approved review6 -
Currently having a stupid fight in my PR comments to remove dead code because I refuse to write a whole book to justify a cleanup commit.
-
When Google (or other companies) make AI that makes another AI or code does the original AI write comments?4
-
When people use so many special characters to decorate their comments that their code looks like Brainfuck code :|1
-
"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
-
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 -
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 -
New guy hasn't written or commuted any code, yet he is the most annoying person doing code reviews with bullshit comments.
Normally when I start at a new shop, I hold off on code reviews until I'm at least familiar with the project(s).1 -
I just don't like copy-pasting the code. can I become a good programmer?
please give honest opinions in the comments.11 -
Genuine question, what was the most comments you've left in a single code review?
Just reviewed pull request submitted by a developer working for a contractor company and needed to leave 70 comments. Seventy.
Opened LinkedIn and saw a post from that same developer saying he left the contracting company an hour ago. I still can't believe it.14 -
Comments belong here on devRant, not in your code!
Code cleanly folks.
“Good code is its own best documentation. As you’re about to add a comment, ask yourself, ‘How can I improve the code so that this comment isn’t needed?'”
– Steve McConnell7 -
Been trying to update some really old C++ piece of code.
And all the comments and variable names are in FR*NCH.
Apparently they didn't had accents in the keyboards back then, because they used stars instead.
Makes it really hard to tell commented code from French comments.
Obs: I don't speak nor can read French. Neither does anyone in my team.11 -
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
-
I read the source code of a guy who decided to name his variables, functions, and comments in Spanish which is not a language I'm familiar with. So I need to first translate the code into English and then understand what it does.1
-
Am I the only one who heavily comments their code when learning a new language to the point of you essentially describing what everything is and how everything works6
-
Raise your hand if you don’t trust the comments in code most of the time, and take at least a superficial look at the code block to ensure that it does what it says it does.
If you have any exceptions, please share.12 -
Code review today and the senior says "Avoid comments. Putting the procedure in a well named function where it can modify those class properties will work just as well."
ARE YOU KIDDING ME? YOU ARE GOING TO PREFER CODE OVERHEAD OVER COMMENTS? I AM SO TRIGGERED RIGHT NOW I CAN'T17 -
Stating the obvious when writing comments. 🙈
I used to this when I was starting to learn how to code and let someone read it, 'cause it's better to have comments than nothing, right? 😂 I was wrong.
But that led me to improve writing informative comments and self-documenting codes. -
"The Perils of Overzealous Code Commenting"
In the land of code, where bugs roam free,
There lived a developer, a comment enthusiast, you see.
Their code was a masterpiece, a work of art,
But the comments? Oh, they took it too far!
For every line of code, a comment did appear,
Explaining the obvious with a touch of fear.
Their obsession with comments, though well-intentioned,
Left fellow developers scratching their heads, bewildered and pensioned.5 -
Hilarious comments check it out on the cancer (stackoverflow.com) 😂
https://stackoverflow.com/questions... -
/me doing the 23rd revision of a PR because my colleague reviewing it comments on every imaginable way his opinion of code standards differ from mine:
git commit -m "." -
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. -
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
-
"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 -
Sometimes my girl talks dirty to me. She says things like:
"I always use double equals in JavaScript"
And
"I don't leave comments in my code"2 -
"A programmer was arrested for writing unreadable code. He refused to comment."
H/T: (@Mr_Drinksonme)1 -
Helping to fix legacy code on a staging server. No version control (at least not that I am aware of). Besides rare code comments, no way to see the author, time, or even purpose of customizations that have been made. No fun!1
-
How do you do to get going quickly again after leaving code unfinished? To-do comments? Separate notes? Something else?6
-
Worst documentation I've seen?
Any+All documentation auto-generator using the (XML) code comments (GhostDoc, etc).
Worthless, utterly and completely worthless. Worse than having no documentation. -
You should write comments in your code, and in case of Perl you must write comments in your code.
I've done some DNS zone editing stuff using Perl's magic around 4 years ago and now I have no fucking idea what's going on in there. It's on production DNS server since then, no problems so far... -
I'm working on a very-customized web player at work.
I filled my code with a plenty of comments, many to justify those functions / fixes.
For those comments, Safari is depicted as worse than Edge.
Is it even possible?
The next dev, which will take my code in his hands, must know how much we suffered to build it.4 -
Reviewing VBA code with least comments possible and out of nowhere there is an Application.Undo which crashes the macro
*Write comments as if the next dev is a psychopath who knows where you leave*2 -
A lecturer just told a class of final year developers approx 50 people that commenting our code should be banned and we shouldn't write comments within our code in case we cause confusion2
-
Always comment your code.
Write comments that explain the reason for this piece of code existing, and why it's written the way it is.
Don't write comments that explain what your code does (unless it's a comment which is going to be parsed as documentation for an API). If your code needs comments to explain what it's doing, you need to write clearer code. -
1. People stop adding too many comments to their code.
2. People stop using too few comments in their code.
3. I wake up one morning and find web assembly has matured overnight. -
if you were looking at one of my project's source code, you could easily guess what's the first file created: that's the only file with absolutely 0 comments in it.
-
1. Forgetting to add comments
2. Inconsistent code indentation, and it is never present when I do not use any IDE (My project buddies get so mad)1 -
I always enjoying snacking on some popcorn while people argue so, what are your thoughts:
Comments in your code - good or bad?4 -
coding all day long and then realising that you haven't commented anything...
after all, deciding not to comment your code because you are lazy and sure that you will know what you did in every single line of code when you were writing it... and then 2-3 month later blaming yourself for not commenting when you have to fix bugs or rewrite the code! damn! -
Whoever left this code with comments like “Le JavaScript” or “Le HTML 5 Shim” I wish you immense anguish.3
-
Never realize how much you hate yourself until you dive into code on an old project.
Damn comments that mean nothing 😣2 -
Those devs that put TODO comments everywhere in code. When has anyone actually ever seen a TODO and DID it? Put the task in jira/trello/whatever and leave the future source of confusion out of the code base!3
-
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. -
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
-
New on the job. Got assigned to a project a former employee didn't finish, thousands of lines of code with barely any comments or uninsightful comments.
Is this what being a developer is like?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
-
When the only comments in your team's entire project is for code that doesn't work, as if everyone's backspace key broke simultaneously
-
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 know, it is unprofessional. I know, it is lacking comments and proper formatting. [...]
I was going through two old codebases of mine.
Here are two code snippets of them.
I find the frustruated comments amusing.
I guess that counts as self-sadistic behavior lol -
Me seeing my code when the agent give me the modification to the project!!!!
WhhhhhhY!
// I'm sorry comments I should've used you more1 -
triggers {
cron('H */1 * * 1-5') // 23 every working day
}
I hate when comments are not updated along with code.
Even more when git blame points at me xD1 -
I want the sticker and that's why I am quoting. "Code never lies, comments sometimes does."undefined programmer coders life commenting coding javascript hacker coding style nodejs angularjs programming java2
-
My code check-in today contains comments like "Last resort methods, never use except explicitly ordered by lead".
Gotta love legacy code hacks... -
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 -
Commenting the code at the end of the day. Not while working on them. Usually end up having comments of create action on update action.
-
When you're the only developer in a group who uses self-commenting code... or comments for that matter.
-
I came across an issue with Visual Studio 2017. I'm unable to collapse multiline comments, there is no - sign in front of it like with code blocks.
At home it is no issue and I can do this without problems.
Ive looked online and all I can find is people not being able to collapse comments in VS Code. And people who want to collapse everything but the comments, but the comments do get collapsed.
Is it a setting I cannot find?2 -
https://github.com/chrislgarry/...
The original code Apollo 11 used in 1965...
Interesting to see that they used comments for more than just readability, much like we do today!1 -
I have to add into develop a code made by a university researcher. The code is in Python 2 for no reason, not all the docstrings are there, no comments (of course) and many, many anti-pythonic practices.
I wanna quit so bad.1 -
I don’t like commented code in a project, I always remove commented code whenever I see. But sometimes these removed commented codes need again to add by uncommenting.
I can get the code by seeing the git history but if only I can remember I removed that portion of code. So is there is any best approach to manage commented code, which may require in real future?3 -
Nothing like code review and have to read the novel that is the comments on the merge request to understand what everyone's issue is with this one doc block. Wtf?
-
I recently saw this on devRant and I thought it was a cool idea.
Why don't we start writing code in each comment down here in order to form some C# (or Java) code working? I'll start from:
public class devRant {8 -
Honestly, am I the same guy who wrote this code 4 years ago? How comes I never commented it! Shit man. What do you do with code that works just fine but you don't know how it works..???2
-
STOP REVIEWING MY CODE!!!! STOP WITH YOUR COMMENTS!! ANOTHER REVISION IS SUPPOSED TO ADDRESS YOUR COMMENTS, SO STOP ADDING INTO IT NOW!!!!!!!4
-
Lead: I don’t think we need to make the changes you suggested at this time, the code looks good to me.
Me: Sure
Lead: However, I want you to submit my code and address all further comments -
Make the comments of a piece of code more complex than the code itself. I don’t know how I do this, it’s like a instinct or something like that1
-
Full code base with 0 comments. Either it's utter genius or terribly poor.
And I'm sitting here reviewing a PR.4 -
Sober me: *stopping working on code fully documented with comments* let's take a break.
Drunk me: * stumbles across still open code* psh what a nerd *deletes comments*
Sober me: * sitting back down* okay where was I... For the love of!
Drunk me is a dick to sober me. Need to lock stuff up better....3 -
“The proper use of comments is to compensate for our failure to express yourself in code.” – Uncle Bob Martin2
-
It feels like there is a rule of the internet that any code snippet visible is immediately subject to review by the comments.1
-
// 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 -
Is it better if my code has 0 comments or 9999999999999 comments as in, literally commenting every single line of code, explaining exactly what the variable is used for, method etc?11
-
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 -
The comments on the code Apollo Guidance Computer (1960s) is so much fun! Also, funny in parts. We modern programmers are too formal in our comments! Code is on Github.
Check it out: http://qz.com/726338/... -
Worst part? Hmm.... A lot.
When you your code should be reviewed by an idiot who suppose to put lame comments/corrections for the sake to keep his position. -
Legacy code horror story.
I had to work on code designed to identify dogs... didn't go well:
https://i.imgur.com/32IXo6Y.gifv
(Credit to reddit: https://co.reddit.com/r/...) -
Code comment in legacy codebase that says "Mr.Foo Bar doesnt understand why this is required but removing it may result in spontaneous combustion"
-
def longVariableNamesEverywhere(*args):
"""
Not a substitute for docstrings and code comments.
"""
#TODO: insert witty and legible code.
#TODO: learn to read code.
return "Rant and self-deprecation complete."4 -
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
-
Blah blah blah, I don’t care, ChatGPT fixed my code and saved me bags of time. I’ll have none of your Luddite comments.7