The Joy of Deletion

I generally dislike these kinds of "Me, too!" posts, but I have to make an exception for Ned Batchelder's excellent blog entry on deleting code. I've often run into this phenomenon with other developers, and it bugged the heck out of me, although I couldn't quantify exactly why. Well, now I can:

This is a companion discussion topic for the original blog entry at:

This would be the entire point of source code control. Using comments in this way is a poor mans SCC. Just delete it, and be done with it. If it was important, you can wander back in the file history and pluck out the old code if you need it. I have to admit, it was a hard habit to break, but once I broke it I’ve never looked back. It’s made life so much easier.

Don’t forget to label the checkin of the deleted code clearly so that it can be found again easily! I have re-written deleted code because it would have taken longer to discover the latest version of the file which contained it.