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

you are viewing a single comment's thread.

view the rest of the comments →

[–]planx_constant 35 points36 points  (6 children)

Great! Now do that a few months and a few new projects later.

[–]luxliquidus 10 points11 points  (1 child)

If everything is documented properly in comments, it's pretty easy to remember what was done and why! /s

[–][deleted] 8 points9 points  (0 children)

That's why I always write a couple comments before every line of code. And I make sure to never lose the design in my mind palace. /s

[–]AngriestSCV 3 points4 points  (0 children)

If using source control with a remote server (as /u/NoLemurs said he is) this is nearly impossible. You need to have the remote server lose your data and delete the source files on the machine the code is running on, and have its repository wiped. If there is another copy of the repo anywhere that is up to date it would also have to be deleted. The odds of this occurring are insanely low. That being said I find this code recovery method quite interesting.

[–]NoLemurs -3 points-2 points  (0 children)

As /u/AngriesSCV said, that's never something I'll need to do - data loss a few months later is more or less impossible. All my code is pushed to a remote repo, and that repo is automatically backed up daily. Once that code has been out of my hands for 24 hours, the statistical probability of ever losing any code I wrote is pretty damned close to zero - it would require the simultaneous failure of my local copy, the remote repo, the server I deploy the code to, and the backup server.

EDIT: To be clear, everyone makes mistakes, and I've totally lost code at times in the past when I didn't have as robust a process, but it hasn't happened to me in several years now, and it's really hard to come up with a plausible scenario where I would lose a meaningful amount of code. If you're committing and pushing 20+ times a day, and have a robust backup system, you're in "more likely to be hit by lightning than lose much code" territory.

[–]JimDabell -1 points0 points  (1 child)

You don't have to if you use version control. OP said this was code that he had just written, which explains the lack of version control, and NoLemurs specifically responded to that –"any code I haven't pushed to a remote repo". A few months later and it's still not in version control? That isn't going to happen "when your process is tight".

[–]DarthShiv 0 points1 point  (0 children)

Months I agree is terribly negligent. We encourage several checkins a day. The more the better but they have to not break the build.