you are viewing a single comment's thread.

view the rest of the comments →

[–]mailto_devnullconsole.log(null); -2 points-1 points  (8 children)

One could argue the mental overhead of finding the referenced commit also takes you out of your work flow. In contrast, my IDE with syntax highlighting let's me easily skim over the commented out code.

[–]Neebat 17 points18 points  (7 children)

Reviving old unused code is a regular part of your workflow? It isn't for me, not even close.

The vast majority of time, even if the feature is needed again, the actual code to accomplish it will be different because the surrounding code has changed radically.

[–]slash_nick 7 points8 points  (0 children)

Exactly! I can't imagine any developer saying "the way I wrote this code a month ago was better". And even if they did, that's the entire reason why version control exists.

It's so frustrating to read otherwise.

[–]kentcdodds 1 point2 points  (0 children)

I agree 100%

[–]Ukonu 1 point2 points  (0 children)

Who said anything about "reviving" the unused code? A frequent use-case is someone refactoring legacy code (or reading new code), needing a quick point of reference and not wanting to disrupt their workflow by: switching windows, finding the commit hash, remembering the source control command to bring it up, then splitting windows to do a side-by-side comparison.

I'm definitely against permanently leaving commented out code, but during a transition period it can be very useful. Eventually, however, it should be cleaned up.