70

When you're trying to fix your code but you don't want to delete anything valuable so you just comment out half of the file 😂

Comments
  • 2
    I don't understand the sentence but I often do that same thing.
  • 5
    I don't understand why people do this. Do you not use version control?
  • 2
    @fyroc Yes, I do, and I do this as well. I'm not sure why, since I know I can always revert.
  • 0
    @spongessuck I don't even revert. I just do a compare, copy the code block I need, paste it into my updated file and then commit. It's cleaner and has less room for errors.
  • 5
    I did this one time when I had to refactor some legacy code to visualize the impact it had on number of lines. Took days, but ended up with a class consisting of 300 lines code, and 1200+ lines commented out below. That moment I got to delete them and commit the clean file was rather satisfying..
  • 1
    I have done this to. Especially if I a unsure if markup is calling the code (does not show in intellisense or resharper).

    Removing it makes it harder when/if markup complains to find where I removed the code.

    And even more so if another dev is following up the error.

    Its harder to search in git since you cannot do that direcly inside visual studio.

    When a release has a few weeks behind it I can then clean up all commented code.
  • 0
    @fyroc I do use a VCS for most projects but this is just a funny thing that I sometimes find myself doing while testing.
  • 0
    @Jase I have definitely hoarded some code before until I found the correct solution.
Add Comment