The name of the anti-save old obsolete code template around

I recently looked at some code that I assigned to our version control system at work, and I found that a bunch of it was replaced (that's OK), but the old version was still there, commented out.

I think the guy felt a little "unsafe" about deleting him, and therefore left him there to comment. However, this is not necessary since we use version control. (The old version was wrong, so in the future she will not like it.)

In these stackoverflow questions, the question of whether to leave the old code in this way is a good idea or not:

  • https://stackoverflow.com/questions/123423/do-you-leave-historical-code-commented-out-in-classes-that-you-update
  • Old code in comments

However, my question is: is there a term for this kind of thing or an “anti-template name” that I can quote when talking with my colleagues about this?

+7
source share
4 answers

"litter".

This is a term that I use personally. As far as I know, this is not a recognized template name. But then I do not recognize any of those listed here. Litter conveys the concept and its value immediately to those who have not read pretty, obscure names.

+3
source

The Anti Patterns book calls it the Lava Flow antipattern , in which old, unused code remains in the code base, regardless of whether it is commented out or not.

+2
source

I saw that it was referred to as "unforgivable sin," but there is no official name that I know of.

It can also lead to code duplication, a long method, or a large Code Smells class if you think the code with comments has a smell. (again). In fact, the more I think “Bad Comments” themselves are code smells. The commented code without any explanation is certainly not a useful “comment”.

+1
source

Wikipedia records this anti-pattern called Boat Anchor . Although I can’t say that I have ever come across this use before I just searched for it.

+1
source

All Articles