Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 6
    Perhaps add the answer to the question: Is it bad practice? Yes, because.... Commented Jun 14, 2017 at 20:54
  • 1
    I sometimes do the same (as OP) because it's easier to uncomment than to revert. In rare cases even if code compiles and passes automatic testing, there is a reason for existence of that code I overlooked that manual tester would spot. In this rare scenario, instead of going through major pain or reverting things several commits later, I just uncomment the code back (and revisit how it can be improved) Commented Jun 14, 2017 at 22:53
  • 2
    @AndrewSavinykh That's different, you are commenting code you are still not sure you want to delete. Commented Jun 15, 2017 at 6:39
  • 6
    @AndrewSavinykh “major pain or reverting things several commits later” – I wonder what version control you use; this shouldn't be a major pain. It certainly isn't in Git, at least not after you've done it a couple of times and learned what to look out for... and provided your history isn't clobbered with needless back-and-forth commits that give you conflicts every other merge. And commits that merely comment something out are rather prone to do this... Commented Jun 15, 2017 at 19:45
  • 4
    @AndrewSavinykh yes, and it's not like I've not experienced these problems – projects whose maintainers never really worked with the version control and put lots of info in comments that should really have been commit messages, rather added new manual-undo-commits instead of properly reverting, etc.. The resulting state of the repository made for lots of conflict fun in every larger rebase... But, and that's my point, these problems are often largely caused by workarounds like the one you defend here. Commented Jun 15, 2017 at 21:09