I've found, what I personally believe to be a bad habit that a lot of developers seem to have adopted. Code in various places in the applications I have seen are commented out (lots of it) and checked into the mainline. Now, I don't have a problem with people doing this with their own branches, but is it a good idea to comment out 60 or so lines of code and check it into trunk? A colleague of mines has unearthed a lot of this and had spend half a day removing the commented out code just to tidy things up. Is there any benefit in checking in commented out code and leaving it for another developer to have to tidy up after you? After all, version control does have a history, so you can easy pull back any code that's been removed.
I see no benefit to this, especially in the main trunk.
Commented out code only provides a quick way for a developer to roll back. The whole point of source control is to have every working version, so that you can keep track of what has changed.
http://blogs.msdn.com/b/abhinaba/archive/2005/11/22/495701.aspx - talks about commenting out large blocks and why they are ugly, and hard to maintain.
Comments do not get verified, and do not evolve with the code base around them. In that way, the commented code will NEVER be valid in the future.... so why keep it at all when there is a perfectly good version that compiles just BEFORE it in the commit list of the main trunk?
There is a good reason, but it probably doesn't often extend to large chunks (60 lines sounds excessive - a small note could have been used instead).
Sometimes you may have to remove some helpful code because the feature requirements change. If you envision that code being useful in the future, commenting it out can be helpful to prevent a future developer from starting from scratch, not knowing that your code ever existed.
Version control gives you access to history, but it doesn't teach you about it..
The modifications can be tracked by version control systems such as SVN. It's easy to see what've done from one version to another. It is no necessary to comment out unused code if you wanna check in to SVN.
I think they comment out the code mainly because they may want to recover what've modified or they're not sure the new modification is correct.
Comments are just "comments", having version control system, we got to keep code clean and tidy.
commented out code also acts as a quick and simple version history. If you don't see the comments, you don't know what was there - regardless of the versioning. I tend to comment out blocks as I'm developing, and happily check them in. However, the caveat is that I will happily remove comment blocks for freshly-checked out code, the intention being that the next revision will always have the comment in there for the next dev to see when debuggging (assuming I make a mistake, they can instantly see what it used to be when it worked) but after that revision it becomes redundant and can be removed. Obviously you need to apply a little common-sense to this, sometimes the comment should be left in for a bit longer, and it doesn't apply to all commented out code.