Quick tip: delete commented code

There’s no reason to leave code commented when checking it in, just delete it. It’s one of the most common pieces of feedback I give while reviewing code.

If you’re commenting code because you think you’ll need it later, it’s in the git commit deleting the code. So there’s no reason to leave it in the code itself. Leaving commented code lying around makes the code harder to read and harder to navigate.

It’s fine to leave it commented while prototyping and testing locally.

If you have any other situations you think you need to leave commented code in a codebase, reply to this email or leave a comment below.