How to delete code

By Matthew Jones

Every large code base I have worked on contains dead code that shouldn’t be there.

Why hasn’t it been deleted? Are there good reasons why it is still there? Why do we have to read it? Can I delete the whole file? Might some of it still be relevant? Why am I wasting my time thinking about this? I’m trying to be productive!

There seems to be a general fear of deleting old code. I hope to allay that fear.

This talk is a fairly personal view about mindset, process, techniques, technical debt, relentless refactoring, and overall, "doing the right thing". It is not language specific, although all the examples will be in C++.





Your Privacy

By clicking "Accept Non-Essential Cookies" you agree ACCU can store non-essential cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

Current Setting: Non-Essential Cookies REJECTED


By clicking "Include Third Party Content" you agree ACCU can forward your IP address to third-party sites (such as YouTube) to enhance the information presented on this site, and that third-party sites may store cookies on your device.

Current Setting: Third Party Content EXCLUDED



Settings can be changed at any time from the Cookie Policy page.