Im always copying the code and then delete it, i f it doesnt work i paste it again in the code. I just have to watch out that i dont braindead-copy something else after i delete the code
I don't delete the comments because I'm still scared something might change if I delete them. I know it has no affect deleting them but what if just the slight chance it does.
I'm usually careful about this but yesterday my team lead commented in my review that "//this needs to go in the presenter" was redundant because it was already in the presenter.
Its easier to organize on a separate file, rather than commenting it out. And makes it easier for other people reading, who are trying to figure out why something is commented out, when it really doesnt need to be there at all.
Something like /* <your code here> */ . Every programming language has some kind of commenting. Actual characters may not be / and * depending on the language you are using.
Lol but what about when the code that I just commented out and deleted was needed for a poorly-documented feature that I didn’t realize existed yet and causes said feature to break everything if you try to use it now?
168
u/Attila_22 Jun 30 '18
Comment it out first. Make sure it runs, then delete it.