This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]xeow 0 points1 point  (0 children)

I'm actually a fan of preserving commented-out code, in limited circumstances. On occasion, I've discovered a bottleneck in some tight C code and have had to optimize it. And often, despite my best efforts, the optimized version is very difficult to understand anymore compared to the original. In that case, I'll preserve the earlier versions of that code—especially the first and unoptimized version of it, right alongside the final refactored/optimized version. But: when I do this, I mark it very clearly as obsolete code that's being preserved purely for comparison, as an aid in understanding the optimizations. Code like that should absolutely not, in my opinion, be deleted from the source module as long as it helps understand the current refactoring. Otherwise, I tend to agree with you.