There is a difference between commenting out code and leaving old code in a solution.

It is assuredly impossible for commented code to call because it might never exist (if compiled) or because it is commented, it can never be reached.

But when you enter into the practice of deploying code that lives but is never called, rest assured, where there is a code path, there is a way, and that code could at some point be called or at worst, triggered by another event or even worst, exploited.

Keep it clean, delete your old code, send it to the grave, it earned it.

Want more? Check out my book Code Your Way Up – available as an eBook or Paperback on Amazon (CAN and US).  I’m also the co-host of the Remotely Prepared podcast.

Author

Write A Comment