3 ms·
Strongly disagree with simultaneously deleting branches and commented out code. We can (and should) safely delete commented code because we have branches which
by morgante 13y ago
Strongly disagree with simultaneously deleting branches and commented out code.
We can (and should) safely delete commented code because we have branches which track the evolution of features and random experiments that might someday be useful. So long as the branches exist, we can always recover that code we just deleted.
But there's not value in deleting old branches. They represent the history of a project's development and should be respected as such.
- antonpirker 13y agoIf you have a naming convention for branches, so you see what branches are expertiments or dead maybe. But I think having a lot of dead experiment branches is like having a huge back log. It just some place where ideas go to die. You stumple upon them once in a while and start thinking about why you never finished them and about how this was a good idea but management killed it and so on. I think it is better to delete them and set your mind free so you can focus on the tasks at hand, not the past.
- pjc50 13y agoDeleting branches from the version control system is heresy. It's there precisely because you know your decisions are fallible and you might want to go back in time to fix them.
- tinco 13y agoIf an experiment that was branched out but abandoned and forgotten, but still possibly useful, then I think it's better if it gets an entry in the documentation. The source repository is a workplace, not a museum. Just create a `bla-rearchitecting-experiment.md` in your `doc/` and paste the relevant code and a paragraph or two about what it does, why it could have been better and why it was abandoned. Now your history is in the place it should be, and not cluttering up the workspace of your successors.
- morgante 13y agoThat's very impractical for large-scale rewrites, which can easily touch dozens of files but still be abandoned (at least temporarily). History belongs, well, in history.
- gburnett 13y agoIn my experience lots of commented code stays around while version control is either underused or unused.
- collyw 13y agoCommented code is easy and available. Trying to search through git history for a comment that maybe contains this word, or maybe that word is a lot more difficult.