Commented-out code distracts the focus from the actual executed code. It creates a noise that increases maintenance code. And because it is never executed, it quickly becomes out of date and invalid.
Commented-out code should be deleted and can be retrieved from source control history if required.
No issue is raised on comments that explicitly introduce documentation or usage examples with prefixes such as e.g.,
e.g:, for example, or example: / examples:. These prefixes are matched case-insensitively. These
comments are intended to show how an API should be used, rather than to keep dead code in the file.
// e.g. step.where(condition);
// e.g: step.where(activeFilter);
// for example registerHandler(listener);
// example:
// convertValue(42);
// examples:
// convertValue(42);
// convertValue("hello");