4 ms·
Ask HN: How do you manage your abandoned code?
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't always get carried over to the final release.
The thing that bothers me is that many times I suspect I wasn't too far off in solving the sticking point, and I sometimes find myself wondering if my initial approach wasn't the better one.
My current solution is to try to move all such code into a private repo for later review, but I don't always have the head-space to interrupt my work and manage that overhead.
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?
- ghostmaree 7y agoFree Daily Accounts! http://ghostmaree.com/ http://ghostmaree.com/
- coderintherye 7y agoPutting 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 7y agoNice - 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.
- simonblack 7y agoI 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 7y agoReviewing 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.