4 ms·
Yes, sometimes (not often) commented out code can be defended. The point of adding why it is commented out is very well taken. Then you can remove it if the rea
by cjfd 5y ago
Yes, sometimes (not often) commented out code can be defended. The point of adding why it is commented out is very well taken. Then you can remove it if the reason for it still being there is not longer applicable. And commented out code tends to go stale quite quickly so if it really is not needed anymore it should be removed.
But I do wonder, if the better option would not have been to make the behavior that you commented out optional. Sometimes one can know beforehand whether a request is actually what people are going to want in the end. Once I wrote variant 1 of a certain feature. This was deemed not good and variant 2 was written. This was also not what people wanted so variant 3 was written. By then I got the inkling that also variant 3 would not be there to stay so I made it an option whether 2 or 3 was in effect. In the end, the final functionality was mostly a lot like variant 1 so the option turned out not be useful but maybe sometimes such optional behavior can sometimes be the best way....