RationalDev

more of an aspiration than a claim

Delete Old Unwanted Code - Don't Leave It Commented Out Or Uncalled

I have seen some horrible code where people have left several different versions of methods that aren’t called. Or perhaps one version is called and several others aren’t. Some versions might be commented out and left for prosperity.

Leave it to source control to keep track of old code, that’s its job. You are using source control aren’t you?

If you are feeling particularly nervous about removing some code, perhaps leave a comment, but I recommend against leaving the code.

Old code will become out of date and also leaves the existing code cluttered and less readable.

Uncalled code just makes it more work for someone who comes along later. Newer IDEs have options to check for references to code, but these are not infallible. If you know code is no longer required, remove it.