(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)
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.
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
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)
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' :-).
Yes!
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
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?
oh so true...
ikr
Yep... This too XD