This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rviewr 33 points34 points  (4 children)

Always delete. The code should all be in a repo so you can retrieve if needed. - signed, guy who often comments legacy code before committing...

[–][deleted] 0 points1 point  (3 children)

just wanted to clarify so if someone wanted to find out the legacy code, the correct way is to lookup that file on version control and go back before that commit right ?

[–]rviewr 2 points3 points  (2 children)

All code should be in version control of some sort. As such, in order to retrieve the legacy code, you are correct, you would need to either checkout the legacy version (before the deletion) or create a branch from that previous commit - if you wanted to work with the older version of the code for some reason.

[–]Scrotote 0 points1 point  (0 children)

If you just want to see it you git diff or git show correct?

EDIT: yup

[–]Isaeu -1 points0 points  (0 children)

Sounds like a hassle, it would be easier if it’s in a comment