DEV Community

Discussion on: Extreme Makeover: Code Edition

Collapse
 
codemouse92 profile image
Jason C. McDonald

In regards to comments, check out the Commenting Showing Intent standard I helped author. I've been using it in production for a few years, with an excellent return on investment.

For anyone who says "clean code shouldn't have comments", please consider -- the cleanest, most obvious code in the world still fails to explain "why". The intent in your code is only obvious to you because you wrote it; to believe anyone else can or should figure it out is expecting nothing short of mind-reading. MANY problems in modern coding can be attributed to this mindset.

Collapse
 
alchermd profile image
John Alcher

I'm personally in the "Clean comments shouldn't have code" camp.

Collapse
 
kip13 profile image
kip • Edited

Is not about to avoid the comments(this are useful of course), is about avoid the redundancy and obvious noise.

Collapse
 
codemouse92 profile image
Jason C. McDonald • Edited

Sure, but that's the difference between "what" (redundant noise) and "why" (never ever redundant to anyone unfamiliar with the code).

Granted, it can be a fine line, but I've found it's better to air on the side of too many comments, leave them for a few weeks, and then come back later and pare back the unhelpful ones that have proven redundant (therefore showing them to be "what" comments).