DEV Community

Discussion on: 6 ways minimalism can help you write clean code

Collapse
 
paulasantamaria profile image
Paula Santamaría

That's a nice tip. Last week I was looking for an ESLint rule to detect commented code and I run into a Github issue where they discussed that there're some cases where commented out code may be useful, like code usage examples. I have to agree that it's not a black or white thing.

Collapse
 
xwero profile image
david duymelinck

The case that comes to mind at the moment is when the client is a/b testing features and they are not sure if they want to keep it of remove it after the testing. When my report comes in I mail them about it, and most of the time they will have a definite decision.

The only time I would put code usage examples in commented code, is when the project has a comments to documentation parser like JSDoc