Pro tip: Reading code is hard enough. Don't leave dead code just lying around, in case you might need to copy/paste it later.

That also goes for commented code. Use git for history if you need it.


@andrioid once I would say, "but come on, sometimes you want to keep a piece of old code for reference, for a couple of days or weeks". But I've recently worked with some pretty complex code that was littered with "deprecated" and/or commented out old code, half-finished code, outdated inline test cases, and stuff. It _really_ wastes time of the developer trying to fix something there.

Keep stale code in your personal notes. Want more of comment color in your files? Write some code documentation instead.

Sign in to participate in the conversation
Mastodon for Tech Folks

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!