DEV Community

Discussion on: Comments Are The Only "Code Smell"

webketje profile image
webketje • Edited on

Read the article with a frown ready to point out the usefulness of comments to explain the why, then got to that section and thought: well done sir :D

(although there are other nasty code smells that are guaranteed to cause trouble; a common example I've come across is functions returning an empty array/ object synchronously that gets populated async after the return with XHR call results, relying on pass-by-reference, when the proper way would be to return a promise. This kind of shit breaks React re-rendering as the prop doesn't change)