News for hackers. Stuff that matters.
Re:Delete your code by morgante on Wednesday April 02, 2014 @05:34AM (#7514408)
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.

Re:Delete your code by pjc50 on Wednesday April 02, 2014 @06:00AM (#7514482)
Deleting 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.
Re:Delete your code by antonpirker on Wednesday April 02, 2014 @05:47AM (#7514440)
If 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.

Re:Delete your code by tinco on Wednesday April 02, 2014 @06:13AM (#7514549)
If 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.

Re:Delete your code by morgante on Wednesday April 02, 2014 @06:32AM (#7514610)
That'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.

Re:Delete your code by gburnett on Wednesday April 02, 2014 @06:21AM (#7514574)
In my experience lots of commented code stays around while version control is either underused or unused.
Re:Delete your code by collyw on Wednesday April 02, 2014 @06:32AM (#7514613)
Commented 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.