(The context here being: working with problematic legacy code and getting to the point where you have new code (paths) that do(es) the same thing but without the issues, so that the old code, and its issues, can just be discarded)
yes. I've been deleting a lot of unused code recently and it feels so good. except for that moment when you realize that the code you deleted is used in another module but this is not documented anywhere
Also, deleting code you wrote earlier in the project because you've made a more general applicable implementation, hence the old code isn't used any longer.
I see some kind of VCS as a baseline project requirement, and in that case commenting out code is a very big anti-pattern.
And even without it, should an obsolete version of a codepath forever remain in your codebase, even long after it's become sufficiently inconsistent as to be irrelevant?
Deleting code.
(The context here being: working with problematic legacy code and getting to the point where you have new code (paths) that do(es) the same thing but without the issues, so that the old code, and its issues, can just be discarded)
ikr
Yes!
oh so true...
Or deleting old code that just exists, is no longer used!
yes. I've been deleting a lot of unused code recently and it feels so good. except for that moment when you realize that the code you deleted is used in another module but this is not documented anywhere
Agreed!
Also, deleting code you wrote earlier in the project because you've made a more general applicable implementation, hence the old code isn't used any longer.
Yeah I saw that as included in the previous, since I don't see 'legacy code' as inherently being 'code written by somebody else' :-).
When we come up with this kind of comments:
I would suggest just comment out codes rather than delete (or have versioning in place).
I see some kind of VCS as a baseline project requirement, and in that case commenting out code is a very big anti-pattern.
And even without it, should an obsolete version of a codepath forever remain in your codebase, even long after it's become sufficiently inconsistent as to be irrelevant?
Yep... This too XD