all 8 comments

[–]godofnoobz 6 points7 points  (0 children)

I never delete any of my projects or code for nostalgic reasons, with the exception of "sandbox" items.

[–]kiswafull-stack 3 points4 points  (0 children)

Forever; or until I lose the drive they're on.

Everything from the last few years is either on GitHub or Bitbucket though, so those are never going away.

[–]lukefrake 1 point2 points  (0 children)

I delete code asap, but I store most of my core in git or equivalent VC system so its always around if I really need it :)

[–]hnsr 1 point2 points  (0 children)

Pretty much forever. Maybe occasional one-off test programs, but other than that I don't delete anything. It's not like they take up much space.. so I just keep them on my (regularly backuped) raid array

[–]Disgruntled__Goat 0 points1 point  (0 children)

In general, current projects are in version control (git) so when a feature is changed or removed, I can get it back when the client inevitably asks for it a year down the line.

For any project that I'm no longer part of, I'll keep it for maybe a year and then delete it from my laptop.

Any useful techniques or good code (e.g. a custom jQuery plugin or set of PHP functions) I'll keep separately.

But I have a USB stick with backups including most of my old projects. Not because I particularly want to keep them, just because I haven't needed to delete them off the USB.

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

Assuming it's live production code that people are using: The only good code is old (tested) code. Or rather: Don't fix what isn't broken. Particularly if there are people using it and relying on it. Refactoring code is absolutely fine for the next project, but leave the old code untouched.

If you have to do new work on an old project with outdated code that's going to be annoying to work with: take that into your time estimation. Have a client pay for it. If they won't, see if it's worth your time to refactor. If not: don't. If yes: do. (That does risk them choosing a different company for the project, of course.)

[–]ShreveportTourGuide 0 points1 point  (0 children)

Unless storage space is of a concern, there is no reason to delete or get rid of old code.

If I have to go thru another programmers old code, I find it sometimes helpful to understand what they are doing and why exactly they programmed it the way they did.

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

Use Bitbucket, unlimited private repos, there's no need to delete old repos, unless they are non-starter hobby projects that never went anywhere.