3 ms·
Only if it doesn't waste space AND holds a lesson that may still be of use to the project. I tend to like code to be structured in a way that allows maximal co
by EntrePrescott 4y ago
Only if it doesn't waste space AND holds a lesson that may still be of use to the project.
I tend to like code to be structured in a way that allows maximal contextual readability (as in: a glance at a page of code should allow to see enough context to understand what's going on)… and that requires to keep any of the clutter that tends to stretch the code too much vertically to a minimum.
So: if it's just a short line so that it fits as an inline comment right side of the corrected version AND holds some lesson that may be of use again, I keep it like that. If it's too long, I just put a succint ref to the problem as an inline comment to the corrected version and move the old code to be replaced into a separate markdown file together with a short explanation of the problem. And if the info of the old version clearly isn't gonna be of any use again, I consider the version control system to be the place for it, not the code either.