6 ms·
Like others have said, you may be surprised! Normally commented out code is at least highlighted differently in more editors. However, it is not unusual for p
by mikekchar 7y ago
Like others have said, you may be surprised! Normally commented out code is at least highlighted differently in more editors. However, it is not unusual for people to complain to me that "if (blah)" is unreadable and must be formatted "if(blah)" (which honestly blows my mind -- you'd think it would be the other way around, if anything!)
One of the biggest thing that catches me out with commented out code is wondering why it is commented out. Is it desirable, but not working for some reason? Is it undesirable, but not deleted for some reason? Is the new code an experiment? Is the old code an experiment? If it's an experiment, am I sure the previous person reinstated the correct code?
Even if you say it can be reinstated in a hurry, why would it need to be? When I'm reading the code, that's one of the questions I'll be thinking about. If I see commented out code, I'll start walking back in history and seeing why the code was replaced. Then I'll be wondering if there is some work flow that perhaps we need to retain for some reason.
All of this takes time. If you really want the code to be gone, it's better for me if you remove it. Then I don't have to wonder why it is there.