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 comment"
-
Pun of the day
Boss: I heard your colleagues hate dealing with code you wrote. Why?
Me: No comment16 -
Real programmers don't comment their code. It was hard to write, it should be hard to understand.24
-
That moment when you make your code such that even dummies can understand it, implement smart ass algos, do all those comment line things for definitions. Then you show your project to your teacher who has this to say :
"Why are you showing me copied code?"
I am like10 -
Code not working.
Comment out code.
Slowly rewrite it bit by bit till it works again.
Check against commented code.
They're the same.
Wtf.
Seven hours wasted on this shit :/3 -
Just saw this comment in our code:
// TODO: think of a better way to do this
Committed June 12, 201215 -
Reading through legacy code, only to discover the comment:
/*
* to the poor guy who has to fix this
* ...
* I'm sorry
*/3 -
A wise man once said:
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
😂😁10 -
When I was intern I saw best use of comment ever. There was a code block that you can only end up there with FATAL ERROR. And there was these lines as a comment :
Last thing I remember, I was
Running for the door
I had to find the passage back
To the place I was before
"Relax, " said the night man,
"We are programmed to receive.
You can check-out any time you like,
But you can never leave! "3 -
Reviewed the code of one of my employees and found that comment: Todo: Improve this if thomas complains.5
-
1. Code works
2. Add if statement
3. Code breaks
4. Comment out if statement
5. Code works
6. Uncomment if statement
7. Code works
8. Wtf??12 -
INTRODUCING:
---
SYNTAX HIGHLIGHT BOT
---
I have lots of ideas.
This was one of them.
Last week I was playing around with https://carbon.now.sh and found it quite cool!
Then I thought: https://carbon.now.sh supports Twitter. Cool. But what about devRant?
So yeah, then I got the idea: A devRant Bot that generates https://carbon.now.sh images!
Now, 4 days and 800 lines of code later, the bot is ready!
I even had to rewrite the notification checking code 4 times, because none of them worked perfectly...
But on the other hand, the final solution is so good that I want to keep it a secret for now ;D
---
HOW TO USE:
All you need to do is to mention the bot!
Example:
<rant>
@highlight
console.log('Hello World!');
</rant>
The bot then generates your syntax highlighted code (as an image) and posts it as comment a few seconds later.
Everything before the "@highlight" will be ignored!
Example:
<rant>
Look at this code:
@highlight
function add(a) {
return a + 1;
}
</rant>
Here, "Look at this code:" will not be included in the syntax highlighted code.
If the comment text ends right after the "@highlight", the bot wont reply, btw.
---
THEME SELECTION:
That's not all!
You can even select the theme for your syntax highlighted code!
Just go to my other rant and read the instructions!
The theme will be used for every image the bot generates for you!
Link:
https://devrant.com/rants/2178551
---
Feel free to ask any questions in the comments!
My creator (and father thanks to @rutee07), @Skayo, will try to answer all of them!
P.S.: Speaking of @rutee07: I'm a girl. (Also thanks to him)167 -
Writes program.
Doesn't comment code.
*Yeah totally gonna remember everything* 🕶
*5 weeks later*
what the heck was I writing.? 🙄😥😭7 -
"Pythonists don't comment, they write readable code."
Yea, tell that to the list comprehension with three lambdas21 -
"I don't need to comment my code because I will remember what everything does/stands for later..."6
-
So my brother had a school project for which he got an 9. I looked at this code and saw this comment. I laughed so hard. 😂23
-
>me on stackoverflow
>a nice question
>i provide a 3 line code with explanation
>comment: 'doesnt work, throws exception'
>i run the code and provide a screenshot that it works
>'doesnt work for me'
>19 line code gets accepted
10/10, would answer again5 -
I've written a lot of bad code, seen a lot, but attached is the most recent 'worst' I've seen.
What makes the situation worse/funny is:
1. The developer's code comment.
2. Check-in passed a code review.
3. The 'legacy code' was written last week.29 -
When you're trying to fix your code but you don't want to delete anything valuable so you just comment out half of the file 😂8
-
@Root has a code review.
CR comment: “Why would you do it this way? It’s awful. Clean it up!”
Totally fair. I had copied the legendary dev’s code, and it was ick. Cleaning it was easy and enjoyable. I cleaned the source, too.
CR comment: “Why would you touch this? It’s outside the scope of the ticket. You could get it working without changing all this.”
Revert…
CR comment: “The interfaces don’t match. Now it’s confusing, and that makes it harder to maintain.”
🤦🏻♀️16 -
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 -
I'm not sure if my in-laws know me really well, or if they are secretly plugged into Github and are making a comment on my code.4
-
Improving an old JS code, replaced all 'var's with 'let's. Previous guy wrote a comment above his variables, which is now saying:
"letiabes"17 -
How to fix an error?
Just comment out the code in the actual framework which throws the error, than fixing your code.😂😂4 -
At least, it was honest comment by developer........
Have you ever encountered such funny statement/code ?3 -
When you see a comment like this in your codebase:
// I don't know what it does, but touching it will break it!4 -
This was an answer to the StackOverflow question, "What is the best comment in source code you have ever encountered?"2
-
Seniors: Welcome to the team. Feel free to ask anything if you need help. There is no such thing as stupid questions.
New Dev: Sure. Thanks.
*a few minutes later*
New Dev: How to comment a code?
Seniors: Google it....and please don't ask stupid questions.11 -
Wondering around some code and I found:
// The next few lines of code should be fairly self-explanatory
// ...
Well if it were so self-explanatory then why TF putting up a comment here!!
Git blame file
Oh sugar it was written by me...1 -
Comment the "why", not the "what". If your code needs comments to explain what it does, rewrite the code (use good, descriptive identifiers).3
-
When you write code and forget to comment it, and then you come back and try to figure out why the heck you wrote certain parts of it.
Let this be a lesson for future me.7 -
When you're looking at your cowerker's code and find a comment :
# Sam, Adam FUCK YOUUUU
Actually Sam is the PM and Adam is the test guy ...1 -
I remember reading a comment on here that as developers, we are really authors. And that has changed how I write (and even read) code. I don't remember who and where it was, but whoever said that: Thank you.
-
Please don't comment in front of the code like this:
doSomething(); // does something
Please just stahp
Do this:
// does something
doSomething();
Much better and friendly for everyone10 -
For those of you who are blessed with being able to use new technologies, enjoy it. I just got handed another system to maintain.. last comment in the code was written in 1995.9
-
Let's comment out this block of code so later we know we have this feature and bring it back if we need it.
Later: commented code everywhere, literally everywhere!!! Shit7 -
Opening somebody else's code(11000+ lines in 2 js files) only to find a 100+ "var a" declarations and naming conventions like var chart1, var chart2. Best part? Not a single comment. Even better? The one who wrote the code doesn't remember what does what.3
-
A badass pull request review comment: 'A wise man can learn more from a foolish question than a fool can learn from a wise answer.'2
-
The one who said "Code should comment itself" must not have used assembly.
I literally wrote this 30 seconds ago and I can't work out what it does now...1 -
I often times write code and think to myself "I don't have to comment this, it's obvious what is going on", only to find myself back at the same code, figuring out wtf it does...1
-
// I wanna know the number of Active Devrant users out of curiosity, please run the code below.
if ( you are dfox || trogus ){
comment( no_of_Active_Users );
} else {
upvote++;
}20 -
Try this code in JS:
++[[]][+[]]+[+[]]
This is valid and returns the string "10" in JavaScript :)))
Source: in comment👇5 -
A list of hilarious comment in code:
http://stackoverflow.com/questions/...
One that I liked in particular:2 -
My co-worker not only doesn't create unit tests, he comment out my own unit tests after he changes the code and the test breaks.11
-
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 -
-> everyone at the company uses git
-> asked to change some stuff
-> boss says "don't remove the old code, just comment it in case we need it in the future"
-> ...
-> ???3 -
Do you know what i hate most?
... commented old code!
What is the fucking purpose to comment old code IF YOU ARE USING A VERSION CONTROL SYSTEM?????
Commented old code is shit, because it fucks the readibility! I saw entire class full of this shit!
DELETE IT, YOU DON'T LOSE IT YOU MORON!!!!5 -
*working on a programming assignment for a graduate-level course*
"We will provide you code that implements the protocol in the server. You do not need to touch this code."
*provided file has syntax errors, including a block comment which doesn't close before EOF*1 -
One of our team members would write his name in a comment before and after every line of code he writes!
Like we got version control we can see the changes that have been made and by whom there is no need for this narcissistic behavior.10 -
My team is quite international and although we speak English among ourselves, most people still comment their code in their mother tongue.
I have learn a lot from reading my colleagues code. Mainly curse words from all over the world. It's great.14 -
Me seriously debugging someone's code.Analysing the code for 15 minutes.I reach end of file and I encounter a comment saying that this file is not being used and he doesn't have time to remove it!2
-
Code comment rant of the day... fcking excel just cost me over half an hour to fix the fking formatting...1
-
Starting a new project:
"I'm gonna write clean and commented CSS today"
===== 20 minutes in =====
"dafuq does this class do? "😣 -
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 -
No matter how much documentation you write, and how well you comment the code, the truth is always the code itself.17
-
Just found this comment in some code I wrote a few months ago... don't think I've ever been more honest!5
-
Found a code comment that states, "//Don't remove. In for a reason." with no further explanation. Um, shouldn't all the code in this project be in for a reason?4
-
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 -
Today I am gonna start writing code in react to replace/improve an old silverlight project.
I need to show react is faster, easier and more efficient than angular.
Thumbs up if you like react and comment if you think I'm wrong 🙂9 -
Made me always think something like:
Code: should i delete it or just comment it out?
Files: should i delete this file or just rename it as .old?
OldHW: should i put it in the bin or i can recycle some parts?
Etc...... -
The best comment I ever read in the production...
/*
* You may think you know what the following code does.
* But you dont. Trust me.
* Fiddle with it, and youll spend many a sleepless
* night cursing the moment you thought youd be clever
* enough to "optimize" the code below.
* Now close this file and go play with something else.
*/ -
First comment by the architects that were reviewing my test, as part of the selection process:
"Well the code was very well documented, not something we see much of..."
Made my day :) -
let's try something...
Roast thread, please tag and insult your fellow devRanter in this comment section. Get creative in finding swearwords. Too many ++ bombs, poor code quality or you're just secretly in love with some other Ranter and hate it.12 -
Me: man, I really want to work on my project but I don't know what to do
Brain: You should document your code, it doesn't have a single fucking comment, you stupid lazy fuck
Me: oh ok, I will do that ...1 -
I dont always comment but when i do, its because i have written some code that may seem like i am a retard on first look.2
-
Rereading old code I wrote and asking myself questions while reading it...then reading the next line, a comment, answering those very questions.
Past self. Thank you very much. 😎 -
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 -
Some advice:
- Be careful with the snack;
- Be moderated with your daily dose of caffeine
- And please, please comment your code even you will not know what were you thinking about when you wrote that 500 line method4 -
Manager : what is "looks good" in code review comment??? You have to be more detailed.
Me in next code review : It is not aesthetically pleasing, but it gets the job done. -
I get very annoyed by sites that ask for too many privileges. If I want to comment on some post why would I give write access to all my source code repositories?1
-
Just read this comment in my code from a few months ago... I guess I was in a strange mood at that time..
// Listen for fuckers. Also known by their muggle name: users.2 -
REAL Programmers Don't //COMMENT their </CODE>.
If it was HARD to WRITE
It Should be HARD to UNDERSTAND
Comment if you "Agreed"8 -
I let my programming buddy comment all the code I write. He's great. His comments looks like this:
/*
I am groot!
*/1 -
If you comment your code like this, I'd like you to rethink your life choices.
This is a project we need to work on in university. The code was given to us.4 -
My internship company does not believe in the concept of 'commenting'. They just tell me: "Ahh just write readable code!
Yeah that's cool until I need to read out thousands of lines of javascript without a single comment!5 -
Programming commandment: Thou shall not commit code snippet copied from StackOverflow without adding a comment to help future coder brethren!
-
The ability to look at uncommented legacy code and read the thoughts of the developer when he wrote it
(seriously, comment your shit!) -
Writing code is like writing poetry. You put your soul into it, you create something so beautiful that everyone appreciates it, but no one fully understands it. So comment your fucking code!6
-
"Mh, I should just write a short comment instead of writing a novel"
// This is a fucking detailed explaination of this shit, even though you can clearly see what it does because I usually write clean code. Also, it's a one-line comment, so have fun side-scrolling -
Note to self:
Fucking comment your fucking code
So I finally got time to work on an old project and now I can't figure out what does what.6 -
Me: Startup initialization tests fail so the system won't boot properly it until we fix those issues.
Manager: comment out the lines of code that are causing problems.
🤔 So we are just going to feed power to some hardware and see what happens I guess1 -
Guys, I just received a *constructive* comment about a code of mine on StackOverflow.
WTF is going on?7 -
*senior dev comes over to my desk*
"Your code is so wrong I didn't even bother to comment on the review." He proceeds to lecture me about why the code that I modified (a 2 year old file I included a tiny helper module in) needs to be rewritten. -
❤️ Swift ❤️
Compiling fails due to many inter-dependent errors (think database deadlocks).
1 - Comment the code that produces the "locking" error.
=> Code compiles.
2 - Uncomment the code that produces the "locking" error.
=> Code compiles.
My peepee hard5 -
In case you need to kill some time and would like to see some funny stuff, here you go: https://stackoverflow.com/questions...
thank me later4 -
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 -
Comment a 1 if you’re a web dev.
Comment a 2 if you’re a game dev.
Comment a 3 if you’re a data scientist.
Comment a 4 if you’re in cyber security.
Comment a 5 if you’re in IT.
Comment a 6 if you don’t fit any of the above categories and you code only in PHP and refuse to learn any other language because you think PHP is the future.50 -
Not sure to delete this block of code... or just comment it out until product owner changes her mind!3
-
Learning through documentation.
I learned one thing.... That how I can copy paste any thing in my code and comment it as "magic happens here do not touch."
Yeah thats my code learned from documentation (image below ) -
It took me way too long to understood what I wrote few weeks ago. After looking at the code for few minutes and looking at my db structure, I finally realized. I also instantly remembered that I wrote that "user is shown as ad" comment hoping I will not confuse myself in future. Apparently I failed.
Temporarily added next line of comment to help the future me.
Deep down I know that I should change function name itself to become clearer, more meaningful and easier to understand.
But writing that comment, making those screenshots, combining the 2 images in Pinta and writing this rant is faster than thinking the new name.3 -
code not working?
comment code and try to run
uncomment piece by piece
code back to original
running...
apparently, the code didn't know it was right3 -
// This part of the code should never run
Came across that lovely comment when fixing a reported bug. Guess where the bug was? You guessed it XD1 -
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 -
Be me
Work at software contracting company
Get a new client, iOS objective-c app with ~40000 lines of code
Previous Dev didn't leave a single comment, and he didn't use a database, he used 'NSUserDefaults' -
Found this comment before a try/catch block in some code I was reviewing... seems like I might have to rewrite the whole thing1
-
An excerpt from the encyclopedia of "Developer Confessions":
At times, when I have no clue what some code does, I comment it out to see what breaks. Sometimes I just want to see the code burn.3 -
When you point out a mistake in your fellow student's code comment and he says: "What doesn't compile, doesn't need to be corrected" -.-1
-
You know you're in for a fun time when you open code you wrote the previous night and a comment starts with "Fuck this, it works, sober me can deal with it"
Why do I do this to myself .-.3 -
Best advice so far: "KISS: Keep It Simple and Stupid"
That works every time because your design of the code will be understandable. Your code must seldom to be refactored. You aren't that asshole who never comment and document anything. And the most important part: The code works as designed without flaws!4 -
Best comment of the day! Found on one of our clients code. (eCommerce)
// If you are full time then please don't refactor this code.
// if you are consultant then charge triple! -
Comment on a code review:
How does this relate to the task?
Me:
Most of the changes have nothing to do with the task, but half of the code & build system was either wrong, broken or not following best practices. This particular change is because something was broken.3 -
Jilano had not even posted a single rant ever and having more than 30000 upvotes.
This changed my idea
"Code sometimes lie
Comment never does."
Commendable!!!1 -
I sometimes wrote song lyrics in comment format on my code while i listen to the music, so my boss will think that i actually write some badass lines of codes.
-
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 fuck5 -
Anybody here who also uses comment tags? I like to leave "M.C. Hammer" in particular snippets of code so other people know that that part... Can't touch this.1
-
Typescript: All of your javascript code is valid typescript
Installs Typescript
runs typescript
Typescript: line x in function y has an error
Checking the function for error and the code is fine
After wasting an hour comment out all the linez in function y
Run typescript
Typescript: you have an error on line x which is commented in function y
ERROR IN A COMMENTED LINE :(4 -
Textbook definition of insanity is debugging in Spyder
While True:
Do:
#Comment out code
Run
If not BUG:
Comment back in
Else:
Print('Congratulations. You found it. Just kidding. It's not THIS line. It's just the combination of lines')
Does anyone have a suggestion for a good python debugger that allows jumping to statements, etc.?2 -
Use that Tab button. It's there for a reason. If you are too lazy to use it then use an IDE that formats the code.
Also learn to comment your code wherever needed and in English. If you don't know where it's needed, Google is your friend if not your senior. -
That feeling when the code in a massive PR is of very high quality... Only comment is about some class name...1
-
Sometimes 3 lines of code can make you question your abilities about yourself, make sure you comment them 😭😭😭😭😭
-
All Chinese who write github codes in English and comment on code in Chinese. Please please stop. Use one language.3
-
Dear last dev, thanks 4 leaving little 2 no //comments as u possibly could. 😑😣😢😠
Please //comment ur code!!1 -
Ignore every single comment that had been passionately written into the code.
Probably thought "if compilers can, why can't I?". -
So, I've posted a question on StackOverflow. I was curious about better (in terms of performance and cleaner code) ways to solve a problem. And a fckn dickhead added a comment like this: Why worry about performance?8
-
There's a comment I left on a code review on Friday that I have absolutely zero recollection of even looking at the review. On the upside, apparently I did work in my sleep..? It's something that was discussed in today's stand-up...
-
Found a comment from a coworker in legacy Code starting with: "For those who are brave enough ..." ⚔️🛡️2
-
"Tahnik, it's about your code that I'm reviewing. There's bool variable called homeMainCreatePostChoseImageFromLibrary. Any idea what that variable is doing?"
"That's the button the user can click to chose an image from library when creating a post"
"Oh ok. Can you put a comment on that variable?"
"..."4 -
Stop commenting out code blocks!
Either fix your shit or delete it.
I am open to argue what fixing may mean, as it is perfectly fine to make your broken code not reachable, e.g. via feature flags or skipping certain tests. Yet never ever should you comment those blocks!
So you say you want to keep it for historic reasons? You know, that is why we use version control! If you ever need certain functionality back, you can restore that state.
Each decent IDE also offers a local history where you can even restore code blocks that weren't even pushed or committed. So use that!
Commenting out test cases is a really bad habit, as you have no reminder that you shall restore it.
And no, a TODO and a FIXME won't count as a reminder as you have to actively look for them. And we all know how well that goes, don't we? (One time, I found a typo of a `TDO`. So even with a regular lookup for TODO, stuff will slip.)
Each test suite offers you ways to skip tests if there are valid reasons why they should not fail the build temporary and they offer colorful feedback. Yes, that means that your tests won't be green, but guess what: That's a feature! They shouldn't be.
That yellow is a fine reminder, aka warning!, that you should really fix your shit.
Commented code screams: "I DON'T KNOW WHAT I WAS DOING!" and it confuses the hell out of other developers ("Was this commented because of debugging purposes and should be active again or can I safely delete this!?") and adds verbose crap to the code base.
If you find yourself to be in a place that you comment code a lot, I also argue that your workflow is broken.
When you are using a decent debugger, there shouldn't that much of a need to comment in and out a lot of code in order to reason about your code-base.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 -
Lesson of the day:
<If a section of your code keeps on bringing errors, just comment it. The code is likely to work./>4 -
This is how my coworker does code reviews... imagine comment on a line of code:
"Oh why does this not do this and that.
Edit: Oh I've read few lines below, now I understand. But this may break when this and that.
Edit: Nevermind I realized, that never happens, forget about it."
Let me just emphasise, that this is single comment, so it's basically editted multiple times, before submition.
Like wtf, just delete the comment then?!2 -
My road trip still lasts for another 5 hours and my laptop does not have power anymore 😧😧😧
I could refactor or comment so much code. Maybe add even more loggings and unit tests, but noooo 😔4 -
Me: *creates new Vue.js project in IntelliJ IDEA*
Also me: *waits for 2 hours*
IntelliJ IDEA:
PS: Also could someone please comment with Vue Land Discord invite link/code that's not expired?3 -
I hate it when you ask a question on so and include the complete code and everything and just get a -1 and no comment or anything.
What the hell. I doing wrong, please tell me !!!5 -
You comment that the fix is in the latest version, tester creates new task PLUS reopen referring to OLD fucked up VeRSiOn!!!
Which fuckin part of testing the latest/commented/tagged/worklogged/code reviewed/merged/invited/CIed version dont you understand?!?!3 -
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
-
"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 -
Lets play a little python game together and win some devRant points :
We have an array of integers named L
We need to sort this array so that the biggest number be in the beginning and lowest at the end..descending order
Rules:
-You are not allowed to write more than one line of code in the comment...only one
-if you comment once...you cannot comment directly after that...you have to wait for two other comments after you so you can comment again
-you have to build your code upon the previous comments ... you cannot start from scratch
-the lucky one who puts the final comment is the winner..and we should all ++ his comment to give him the biggest amount of points
Lets start and see who will win :)15 -
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 -
I just don't like copy-pasting the code. can I become a good programmer?
please give honest opinions in the comments.11 -
Hilarious comments check it out on the cancer (stackoverflow.com) 😂
https://stackoverflow.com/questions... -
What is the most unusual use of a programming language comment that you have come across?
I'll start with this one. On the Sinclair ZX81, a REM comment was used to reserve a space, into which you could poke machine code! -
When your code is accepted after you forgot about the comment about your boss being a Tw*t... Surprise.1
-
"A programmer was arrested for writing unreadable code. He refused to comment."
H/T: (@Mr_Drinksonme)1 -
You know what's worse than reading someone else's code? Reading someone else's code with comments that make absolutely no sense!
It's like deciphering hieroglyphics. If you're going to comment, at least give me a hint, not a riddle.
It's not a treasure hunt; it's coding!2 -
Debugging an issue last week that involved a duplicate class. Took about 10 mins of debugging (console.log) to realize the function wasn't being called.
Me to the person I was helping: we should comment that this is deprecated, can you add it?
Today while reading over the (unchanged) code, I see a comment block above the class **that I wrote awhile ago** which says exactly that...1 -
#kotlin
when you don't know whether you are writing code, or is it a comment.
doing #java for couple of years has its effects. -
does my co-worker code is actually really necessary, for the sake of arguments lets ignore server performance, and focus on this snippet.
added comment on the side of the parameters11 -
Reading documentation for 3rd party software... come across a code snippet which references a class. The class is spelt correctly in the comment but wrong in the code!
What??? Surely if you're going to get it wrong it would be the other way round :/ -
Another student pushed code to Github. Asked why there wasn't a single comment. He said there was no need since he used good names for his variables... *sigh*
-
#weeklyrant: a rubber duck AI that responds to your jabbering and helps you to find that stupid forgotten ; in your code. And comment the hell out of your code so you will understand later on.
-
When you're trying to figure it out what a code does and you find a line comment "A line off code to rule them all"
cheers Frodo! -
I am the only engineer in my company, we develop and sell software solutions to a niece market.
In 1 year and a half i developed software for Android, IOS, Windows Desktop, web applications and an IoT solution........... My code has not a single line of comment....2 -
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! -
On One of those frustrating day when u try to fix broken live application and you find where's the issue but above that code some one wrote comment saying FIX THIS. What are the chances.
-
Arg, Visual Studio 2015, stop trying to fix my comment indentation!
It's a comment and. It is NOT part of the code. Leave my formatting alone!!!3 -
Write bad code, dont comment, do all these, if you want....
But never never never us
Windows as your server operating system4 -
¡Rant
I am a simple man, i see code in comment
I ++ it.
Me= simple;
While (On.Devrant) {
Cin>>code;// Cin as seen (through eyes)
I++; // that i increment it { got the joke?}
}2 -
When you compare your past with your old code:
The improvements you could have made, if you had known what you know now.
A commit a day would have kept everything up to date.
A comment every now and then would have made choices understandable
Using classes would have made it easier to replace or reuse code.
Now you have to figure out what the code is supposed to do, and rewrite it.1 -
3 hours to understand that I needed an if for my code to work like it was supossed.
I need more coffee and sleep...
And just posted this rant as a comment to another rant. I am so fucked up. And the holidays just begun....2 -
My partner randomly commit to the git.
"A missing semi colon"
"initiate a useless variable"
"adding comment to obvious code"
Hmm ok im done for the week.1 -
I don't always wreck the production environment, but when I do it's because I'm trying to refactor a piece of code with a "// this is here for reasons, don't change this" comment above it.
-
To all devs who don't comment their Code
WHO THE FUCK SHOULD KNOW WHAT YOU INTENDED WITH YOUR FUCKING PIECE OF CODE
Well - I am one of you. I'm realy lazy in commenting. But it is very hard to understand a piece of code if you are not used to a complex architecture.
If there will ever be the chance of having another dev seeing your Code:
COMMENT IT1 -
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. -
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
-
More frequent commits are imperative to your sanity!
Trying to find a code change in git, and I stumbled across a commit comment I can't even remember doing!1 -
Stack Overflow question on best comment ever. My fav:
try {
} finally { // should never happen
}
http://stackoverflow.com/questions/... -
Inspired by someone here who said we should be the Shakespeare of code, how about we comment/show any great, clean and open code that we found here?2
-
I was asked to fix a bug delaying the app's email notification. When I opened the notification code file, I saw this comment previous developer wrote, it goes like
-----*This code works 70% of the time, if I try to change anything, the whole profile breaks. Please do not touch this code!. It does not worth the try*-----
Now I don't know what to do😂😂 -
Do you write your comments before or after you write the code?
Do you write var foo = 1; and then go back a line above it / beside it to comment, or do you write the comment line / block first prior to writing the code statement?6 -
Why do I always get the response: "just comment your code better" whenever im looking into ways to make my files smaller and more pleasant to read by abstracting big chunks into different files.
Or when i want to generate some documentation with storybooks or something.
Is it just me or am i that rebellious by wanting cleaner code..2 -
reading the project's code, following "save" callback in jvascript, i find this comment "IMPORTANT : this is a workaround to solve memory leak" and below it code that basically removes all elements from th DOM and adds them again.
so basically, someone could not find a cause to a memory leak and decided "solve it" in a specific place by reloading almost an entire page -
Found bug in legacy code with comment "4 days to release workaround, works predictably".
Added "No, it doesn't!" and committed to main branch before I start reworking the entire spaghetti mess of a codebase -
write comment above block of code
or pull block of code out into method and work the comment into method name11 -
We have this guy at our office that is constantly sending mails complaining about our code. About 10 min. after a commit he's either complaining or come with some condescending "ok" comment.
-
Came across this comment on r/programminghorror/
> We're you talking with my co-worker? He's extremely abrasive, especially when it comes to anyone touching his code because "Now I don't know how it works anymore" -
I have the misfortune of reading the source code that there are comment on who change what line of code at "actual source file" instead of just using version control.2
-
Can someone code a chatgpt bot for devrant where it extracts transcript of a tiktok video and makes a comment/post on devrant
Example
@ chatgpt --tiktok-url=https://vm.tiktok.com/ZMYafgCMP/ --generate-transcript=true55 -
A clever code that works but is difficult to understand or a well written commented code that’s easy to understand but does not work ?
Comment below:9 -
Hey hackers,
Let's talk about the problem statement first!
In software engineering, engineers often procrastinate when it comes to writing comments for documentation purposes. As they delay properly documenting their codebase, they are even more likely to procrastinate on updating their previously written comments when they make changes to their functions or code. This can lead to chaotic and buggy code, and if not addressed, it completely obsolete or even counter intuitive the purpose of comments in the code.
Solution!
A tool that automatically detects changes in a function or code and compares them with the current comment description. If there is a discrepancy between the code and the comment, the tool either automatically updates the comment or allows the user to manually select the code and its associated comment to directly make changes using LLM's.
So, my question is: Is this idea worth working on? Is it a real problem, or am I just overthinking it? If anyone has a better idea, please share it in the comments. Also, if someone is working on this problem already or planning to work on this in future, we can collaborate. This will be an open-source project.
Sign out, Peace!
github: priyanshu-kun/project-kento13 -
Got a full stack job in a really large org. They write shit code and refuse to comment on code saying the code should explain itself.
And I’m like yeah but if you’re writing spaghetti code at least fucking comment why.
The new job’s pay is like 2x my old job so it’s really fucking good pay but my brain is melting from frustrations with these devs.4 -
Remarked out code which has been commented out since 2015, now been checked in with a simple line comment of todo above it .....
-
What is it with colleagues here not even thinking of making a comment in code that directly interacts with hardware.
They will write to the same register 4 times with different values, which is intentional I believe, but not bother to put one comment in there vagely explaining that it is in fact not a copy paste error...2 -
That feeling when you're optimizing your code and comment a small function to compare results, then few hours later you push to production and forget everything about that function.
It aint pretty, nope I can't run away from this one!2 -
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 -
Android project using Java is so shitty. The amount of boilerplate code literally give me cancer... and don't comment about libs/plugins, i know all those but we aren't allowed to add them into the project.
-
(after morning coffee) Today I’ll change the world and write the most elegant and revolutionary piece of code ever.
(end of day, after 8 zoom meetings and 5 gdocs comment rounds) guess i’ll do these 2 PR reviews tomorrow.1 -
Being told all those crazy startup ideas by friends and family with the comment "this is so simple, I'm sure I can learn to code and do it in 2 weeks"
-
I have a habit to comment every single line of code, this helps comprehension but this dirty the code and everyone complain. Is it any way to do such task.6
-
Is there a way to comment out another team? Not their code, the actual team members. Is there a node module for that?4
-
That moment your pair programmer doesnt comment his code whatsoever, and your'e spending half a day trying to understand what it was he's trying to do😠4
-
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 -
How do you tell someone their code sucks?? Like why dont you indent?? What's wrong with using useful class names? At least chuck a comment in there...
-
Is this a justified code review comment or a bully?
Code reviews are weakness of this industry which has the potential to attract bullies. Abuse of the comment box in a pull request and bombarding the employee with hundreds of comments can cause stress, frustration, burnout and finally resignation and costs of fulfillment for the organization. While companies should find and stop bullying in the work place, what kind of code review comment is considered a bully and why? Any of below traits can mean you are dealing with a bully:
1. Claims the code needs to be changed but doesn't say how. So no matter how many times you change your code, he can repeat the same comment: "Your code is still bad due to blah blah and it needs to be changed".
2. Provides how the code should be changed, but the change doesn't add up to quality, security, performance, readability, etc. i.e. "Why did you use a for loop here? Use a while loop instead". Or "Why did you write it using three classes A, B and C? Instead write it using 4 classes D, E, F and G which does blah blah". In the later case, not following the review comment, you won't get approval. Following the comment means you need to rewrite your whole code. After which, you might again receive more comments to change other parts of your code!
3. Claims the requested change is due to standards but claimed standard does exist anywhere. Internet, company wiki, university course books, anywhere. In more severe cases of psychopathy, the bullying person refers you to a link which hours later turned out to be written by himself! Have fun describing what has happened to your manager or team leader... .
4. Asks the code to be changed in a way that supposedly is closer to standard or of better quality, security, performance, etc. But the proposed way will not work and is the main reason you didn't do that in the first place. So you start arguing forever in the comment box over why his method won't work!
If you cannot see any of the above traits, then keep calm, take a breath, fix your code. Otherwise you might be victim of a bully.3 -
Code comment in legacy codebase that says "Mr.Foo Bar doesnt understand why this is required but removing it may result in spontaneous combustion"
-
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
-
Learn to comment as part of writing your code.
Its tough to pick up afterwards; my current workflow is to write all my code for a day then start commenting for the last half hour of the day. I have shame.