What should we do with outdated code in source control – delete it or archive it?

0
7
Asked By CuriousCoder92 On

At my workplace, we use Azure DevOps TFVC for our source control system. We have a single project that contains numerous applications and Visual Studio solutions organized into folders by application type. With some applications being phased out, I'm in favor of deleting the code and its corresponding folder. My understanding is that even if we delete it, the code remains accessible in the commit history, so we could always restore it if necessary. However, my boss is hesitant about deletion, fearing the permanent loss of the code, and prefers to move the code to an 'Archive' folder instead. I believe that this could cause more issues: 1) The archived code is still visible. 2) It still gets downloaded unless we take extra steps to cloak the folder. 3) It will clutter search results. 4) Moving the code creates a duplicate in the archive which can confuse our history. 5) It adds unnecessary complexity. I'm curious to know how other development teams handle similar situations.

5 Answers

Answered By DevWizard101 On

If you’re using a version control system like TFVC, just delete the outdated code. It’ll still exist in previous commits, so it’s not really gone. Keeping it around doesn't serve much purpose and can lead to clutter. Your boss might be worried, but the reality is that source control is meant to handle this — deletions aren’t permanent, you can always go back in history and retrieve it if necessary.

Answered By TechieTina On

I think you should consider tagging it and then removing it. That way, if someone needs to refer back to it later, you can still access it via the commit history. The archive folder idea can just clutter the workspace and create confusion in the future — it makes sense to clear out what you no longer need.

Answered By SkepticalDev On

Look, keeping outdated code around just complicates things. It becomes a liability. I’d recommend deleting it — and your boss might just need a demo to see how easy it is to retrieve something that's been deleted. The point of source control is to manage all this, so reassure him that it’s safe to go ahead!

Answered By CodeNinja99 On

I totally feel where your boss is coming from — deleting can sound scary. But honestly, if it's really done and dusted, just delete it. Use version control's tagging feature if you want to keep a snapshot before deletion. This way, you'll have it backed up and can easily revert if needed. Having it lying around just adds unnecessary baggage.

Answered By GeekyDev25 On

In my experience, the best move is to archive the outdated code in a separate repository. It keeps the main workspace clean while allowing access if needed later. Just make sure to limit access to that archived repo so it's not a distraction for the team. But I wouldn't recommend just moving everything to an archive folder in the same repo — that can get messy fast.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.