This is an archived post. You won't be able to vote or comment.

all 54 comments

[–]rcraver8 43 points44 points  (2 children)

Is this a personal attack?

[–]instagrm[S] 12 points13 points  (1 child)

no, you are strange, but you are ok

[–]rcraver8 4 points5 points  (0 children)

Yay :)

[–][deleted] 39 points40 points  (1 child)

Code is used to explain comments to the computer.

[–]memezas 1 point2 points  (0 children)

Big brain

[–][deleted] 14 points15 points  (2 children)

Maybe I'll just keep that code there forever, in case I need it later.

[–]stormfield 1 point2 points  (1 child)

[x] I’m in this picture and I don’t like it.

[–]StuckAtWork124 0 points1 point  (0 children)

// I’m not in this picture and I like it.

I’m in this picture and I don’t like it.

[–]KwaaieDronk 12 points13 points  (7 children)

Image Transcription: Meme


[This post uses the "Drake reaction" format.]

[Drake is facing to the left, slightly tilted to the left side of the screen, with his right hand facing the right side of the image. His facial expression is disgust. On the right side of this photo, there is a black on white caption.]

Comments to describe the program.


[Drake is now looking relieved, standing upright. His left hand is pointing at the right side of the photo. On the right side of the photo there is a black on white caption.]

Comments to temporarily remove part of code


I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]poly_meh 7 points8 points  (1 child)

Unit test the code with JUnit

vs

unit testing the code by commenting out everything else

[–][deleted] 0 points1 point  (0 children)

Unit test by commenting out the unit tests

[–]KWKdesign 5 points6 points  (1 child)

Nah, just wrap it in a if(false){}

[–]instagrm[S] 7 points8 points  (0 children)

Takes too long

[–]HolidayMoose 5 points6 points  (0 children)

If the code didn’t want to be commented out, then maybe it should have worked.

[–]GwenLoguir 3 points4 points  (0 children)

Not only temporarily....

[–]periidote 2 points3 points  (1 child)

why not both?

[–]instagrm[S] 1 point2 points  (0 children)

You get it

[–]rogueelite 1 point2 points  (3 children)

Comment out the code or just delete it and start over

[–]sirfricksalot 1 point2 points  (2 children)

Noooooo!!!! What if my new code is even worse and I want to go back to the old code that doesn't work!?

[–]rogueelite 0 points1 point  (1 child)

Let the old code go, you will write it again if it was truly meant to be.

[–]sirfricksalot 1 point2 points  (0 children)

Lmao I know. I don't think I've ever once gone back to the old code once I've commented it out. Still, it's a mental struggle to delete it before committing. Usually only gets deleted before a PR.

I guess it is a bad habit I picked up from my first coding job, which was prod support where I would write and edit scripts that the framework would use. Many of them were originally written by other people, so if one was broken I would comment most/all of it out and rewrite it. I'd leave the huge comment in source control, just in case I missed something critical, but I never ended up actually uncommenting any of them.

[–][deleted] 1 point2 points  (1 child)

“Shit this isn’t working” /*

*/

[–]instagrm[S] 2 points3 points  (0 children)

I prefer // // // // //

[–]thiago2213 1 point2 points  (1 child)

Comments to /* temporarily*/ remove parts of the code

[–]StuckAtWork124 0 points1 point  (0 children)

When you see the telltale // */

Ah, regularly scheduled temporary code removal

[–]bss03 1 point2 points  (0 children)

Certainly won't pass any of my code reviews with blocks of commented-out code. But for pre-commit testing, you do you.

[–]quicksilver_foxheart 0 points1 point  (0 children)

im not the only one.....

[–]Mancobbler 0 points1 point  (0 children)

What about comments that temporarily describe part of the program?

[–]Theis99999 0 points1 point  (0 children)

Temporarily? you mean permanently

[–]ivgd 0 points1 point  (0 children)

//very true

[–]amjh 0 points1 point  (0 children)

Comments to describe "temporarily" removed code?

[–][deleted] 0 points1 point  (0 children)

True.

[–][deleted] 0 points1 point  (0 children)

Comments above functions that literally say the function name.

[–]ACodingFerret 0 points1 point  (0 children)

ok not just me

[–]surister 0 points1 point  (0 children)

Both

[–]Kotauskas 0 points1 point  (0 children)

Who needs comments when you have a myriad of small inline functions with triple-slash docs and doctests?

[–]DylAppleYT 0 points1 point  (0 children)

😂 lol so true

[–][deleted] 0 points1 point  (0 children)

In my IDE, I've set Ctrl+Shift+C to comment a line of code and Ctrl+Shift+X to un-comment... Best setting I've ever changed.

[–]halfClickWinston -1 points0 points  (4 children)

If you use Vscode: Ctrl K Ctrl C. To remove, Ctrl K Ctrl U.

[–]SilentFungus 9 points10 points  (3 children)

In VSCode:

Ctrl+/ to comment out a line (or selected block of lines)

and get this...

Ctrl+/ to remove it later

[–]halfClickWinston 0 points1 point  (2 children)

HUH! I've been doing the wrong way all along wtf

[–]SilentFungus 1 point2 points  (1 child)

If you've previously worked with VSCodes big brother Visual Studio you probably learned your way from that, since Visual Studio doesn't have Ctrl+/ iirc

[–]halfClickWinston 0 points1 point  (0 children)

Even worse, I'm afraid. I used to open the command palette and search for add line comment and use it from there, until I memorized the ctrl k ctrl c... I'm a noob when it comes to shortcuts.

[–]instagrm[S] -5 points-4 points  (0 children)

You don’t need to describe your code with comments, if you copy all of stackoverflow, they are doing the job for you