During development, I sometimes try to use a technique or method that is not immediately disclosed. As soon as I decide to move to another task or try a different method for the same task, Iβm never sure what to do with non-working code. I want to save it as a record of what I tried, so I know it doesn't work, or even as a starting point for trying to get it to work again.
Usually I just leave the code in place, commented out and not connected to VCS for some time. However, this becomes a pain as it clutters the code and must be avoided by VCS commits. I use git, which has a "stash" function for temporary storage, but I'm not sure if this is a suitable use.
How do you handle the code that you want to keep for posterity but donβt want as part of your main code base?
source share