Spyke

This is why I love the "find usages" inspection, though the IDE (at least JetBrains ones) will usually preemptively warn you about unused methods and functions.

If it's a block of logic in the middle of a function that you suspect is no longer needed, set a breakpoint in it and run the program before deleting it just to make sure it's not being triggered.

4

Oof, just did that a couple of days ago, in prod no less (not able to test particular change in lower envs). Good times.

1

That's why we comment first, then use version controls. Also we never test in prod.

ROFL yeah right!

1

Fortunately:

  1. I quit the editor without saving the changes
  2. I have a previous version that still contains the block in question
  3. I have a few onions on which I can blame my tears
1

You reached the end

When you delete a block of code that you thought was useless | Spyke