DEV Community

Discussion on: How do you make it easier to search through version control for deleted code?

Collapse
 
eljayadobe profile image
Eljay-Adobe

Excellent! +1

I've also picked up some habits that I find very useful.

To delete dead code:

  • comment out the code
  • check in the change
  • delete the code
  • check in the change

To delete a file:

  • delete all the lines of the file
  • add one line, a comment, saying the file is being delete
  • check in the change
  • delete the file
  • check in the change

Saved my bacon many time.

And for those who are unfamiliar with clean code, read the book Clean Code by Robert Martin. It's got good mojo.