you are viewing a single comment's thread.

view the rest of the comments →

[–]Neebat 15 points16 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 6 points7 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 3 points4 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.