
Ask HN: How do you manage your abandoned code? - ajdruff
There are times that I have invested quite some time into a chunk of code and realize that sometimes its just better to abandon it entirely and try a different approach. This code often contains useful  techniques that don&#x27;t always get carried over to the final release.<p>The thing that bothers me is that many times I suspect I wasn&#x27;t too far off in solving the sticking point, and I sometimes find myself wondering if my initial approach wasn&#x27;t the better one.<p>My current solution is to try to move all such code into a private repo for later review, but I don&#x27;t always have the head-space to interrupt my work and manage that overhead.<p>What are your techniques or tools that you leverage in managing your abandoned code? 
Do  you commit it somewhere for a later review by yourself or a team member? Do you just git stash and move on?
======
simonblack
I _never_ destroy the source code directory. I still have projects from 30-odd
years ago that get looked at from time to time for some silly reason or other.

I move the project directory out of the main work area where current projects
live to another area like 'obsolete' or perhaps 'non-current'. It still
exists, but it isn't continually in your vision.

Disk space is cheap. Your time and angst are not.

~~~
ajdruff
Reviewing old code brings back memories. I've got stacks of hard drives but
not the time to organize them unfortunately, and not all of the code is pushed
to a remote repo.

------
coderintherye
Putting it in a "Gist" is pretty easy on github:
[http://gist.github.com/](http://gist.github.com/) (note use "create secret
gist" for code you wish to keep private)

~~~
ajdruff
Nice - I totally forgot about Gists. I've used them in the past but strayed
when I found them lacking when it comes to keeping them organized. Your
comment did make me go re-look at Gists though and reminded me about GistBox
and other related services that fill in some of the gaps. I think for the time
being though I'll just work off of a local repo and build out my Gist library
that way.

