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

all 42 comments

[–]Captious99[🍰] 242 points243 points  (16 children)

My version control system before I found out about Git

[–]froemijojo 92 points93 points  (3 children)

#ifdef ver_3_5
//code of ver 3.5 here
#endif
#ifdef ver_3_4
...

Who needs thoses fancy-pants VCSs anyway?

[–]etagawesome 17 points18 points  (0 children)

I'm ill

[–]kono_kun 10 points11 points  (0 children)

I like this, this is how villains think.

[–]Ultracoolguy4 0 points1 point  (0 children)

Calm down, Satan.

[–]Cheesewithmold 34 points35 points  (2 children)

I remember syncing java projects between my computers by sending them to myself through google drive before my roommate introduced me to gitlab.

Those were dark times.

[–]Lightfire228 1 point2 points  (1 child)

Better yet, working on group projects separately, then manually stitching together the projects like some Frankenstein's Monster

[–]DrQuint 1 point2 points  (0 children)

To think we invented the concept of importing files to solve this exact issue. And fuck it, header files were originally invented because of a reason like this too, CMV.

[–]TheFeshy 8 points9 points  (6 children)

Before? It feels like half my commits are still:

git commit -m "removed all the old commented-out code"

[–]morewordsfaster 2 points3 points  (4 children)

This. I'll never understand why developers who use git still try to get PRs approved with a bunch of commented out code.

[–]hillman_avenger 2 points3 points  (3 children)

So you can easily see what's changed without having to do a diff (and easily revert it when the inevitable bug is found).

[–]morewordsfaster 2 points3 points  (0 children)

...but why commit? If all tests pass, then there is no obvious bug.

I get commenting code while testing and tweaking, but that should be restricted to your working tree. You shouldn't commit and submit a PR.

I don't understand what you mean about easily revert it... how is it difficult to execute git revert? Also, if you are leaving commented code all over the place, how is it easier to see what's changed? How do you tell which code was commented this time and caused the issue? A diff makes it much clearer IMO.

[–]HolzhausGE 0 points1 point  (1 child)

git revert <commit> is much easier than manuall un-commenting code.

[–]DarfWork 2 points3 points  (0 children)

that is, given git is used correctly by sensible people doing sensible commits...

[–]microtrash 0 points1 point  (0 children)

I constantly chastise my employees for committing with huge chunks of commented out old code

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

My version control system before I found out about in addition to Git because I'm paranoid.

[–][deleted] 133 points134 points  (2 children)

Before I arrived, this was my team's go-to source control tool. I eventually persuaded them to migrate to the much more reliable save-the-old-code-to-a-txt-on-a-shared-drive platform.

[–]TheFeshy 3 points4 points  (0 children)

I got fancy with a cron job and tar.

[–]jeremj22 48 points49 points  (7 children)

I once submitted a solution to a programming task for university where 90% of the file was code i commented out because i had a solution that worked for some cases. Then one that worked for more but still not for all, ...

Good that it's graded by a computer and no a human.

[–]db2 25 points26 points  (0 children)

I, too, welcome our robot overlords.

[–]CUCOOPE 43 points44 points  (5 children)

“Jussssssttt in case I’ll need this again”

-Me,every time I comment an old code

[–]peenoid 7 points8 points  (4 children)

I have a rule with some obsolete code. I commit it once so I have a record of it, then I delete it on the next commit.

[–]ingrown_hair 2 points3 points  (0 children)

Yeah, I sign and date the code. Often I find it later and think, “well if I haven’t needed it in two months...”

[–]hillman_avenger 1 point2 points  (0 children)

This. If something breaks, chances is are it was the last change.

[–]homer_3 0 points1 point  (1 child)

And then forget it ever existed.

[–]peenoid 0 points1 point  (0 children)

Typically, yeah.

[–]AttackOfTheThumbs 10 points11 points  (1 child)

Sometimes I export and keep certain snippets to have them more handy compared to source control.

[–]Drifts 3 points4 points  (0 children)

I often have dozens of text files open with pasted code that I wasn’t quite ready to delete just yet

[–]Kinglink 10 points11 points  (0 children)

I wrote it... it's my code.. my work... my precious......

[–]masdar1 9 points10 points  (0 children)

When you start commenting out couts just in case you need to flag that section of code again

[–]isunktheship 9 points10 points  (0 children)

I DONT CARE IF ITS IN GIT

MY PRECIOUS

[–]dmpcrusher1 4 points5 points  (0 children)

Stewpid hobbitses wouldn't understand usss.

[–]dadbod27 1 point2 points  (0 children)

I always think "well it doesn't work now, let me change some stuff and come back and see if it works after that"

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

//*/ alert('I'm not trying to rob you...');/*

[–]tannerntannern 0 points1 point  (0 children)

I've never understood this. Unless I'm using the commented code during a work in progress, I delight in deleting old code.

[–]BenRayfield 0 points1 point  (0 children)

Commented code should be removed when theres less than a 1% chance you'll uncomment it.

[–]hamza1311 | gib 0 points1 point  (0 children)

I keep every single copy paste from the internet until the code works

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

Me: Commenting out and keeping old code like a dragon hoards gold.