Delete commented-out code instead of retaining it in the codebase. Commented code creates confusion, adds maintenance overhead, and clutters the source files. If code is no longer needed, remove it entirely - version control systems will preserve the history if it needs to be referenced later.
Delete commented-out code instead of retaining it in the codebase. Commented code creates confusion, adds maintenance overhead, and clutters the source files. If code is no longer needed, remove it entirely - version control systems will preserve the history if it needs to be referenced later.
Example of what to avoid:
// export function isActionError(error: any): error is ActionError {
// return error && typeof error === "object" && "error" in error && error.error;
// }
export function newFunction() {
// Implementation
}
Instead, simply delete unused code:
export function newFunction() {
// Implementation
}
If you need to temporarily disable code during development:
This keeps the codebase clean, reduces cognitive load when reading code, and prevents outdated commented code from becoming misleading over time.
Enter the URL of a public GitHub repository