I don't know if I touch a delicate subject here, at least it doesn't seem to be easy...
There are many VCS out there, plenty more posts/blogs/... describing how efficient they are. And there are also many suggestions to remove stuff from the code when it isn't needed (clean code). There are always sentences like "it doesn't get lost anyway", "you can always get back to it", ...
I can't quite follow that. Let's say there a few developers working on one particular project. New requirements appear on the scene resulting in creating, modifying and deleting code. And hopefully refactoring.
In reality it happens occasionally that a certain feature is required, then dropped and then re-added later. In other words there was code written already. That code got written during the "required" phase and got removed during the "not any more" phase. What happens in the "re-added" phase? Some may suggest to rewrite the code, but I don't consider that an option here. Actually the "old" code might include fixes for problems that arose back then.
The project isn't small, many classes, plenty of logic, maybe some personnel changes, you get the idea. IMHO it's not fair to always expect from at least one developer to remember that there was code written and where it happened (including branch names).
Is there any support from a VCS to answer questions like
- Where was a yet removed particular method and I only have a vague guess about its name?
- I'm pretty sure that there was an if-statement right here, but what happened to it?
- ...
I don't want to restrict this question to one VCS. It should be more of a general question. If anyone cares, we currently use Mercurial.