DEV Community

Discussion on: I love to document my code. Am I doing it wrong?

Collapse
 
stiv_ml profile image
Stiv Marcano

IMHO, the only reason you should document all of your code is because you're making a public API where people is not going to be able to read your code. In that case, it's a must. But commenting self explanatory things, like a property called 'name' in a 'Person' object, it's not worth and just adds noise to your code.

Collapse
 
clovis1122 profile image
José Clovis Ramírez de la Rosa • Edited

The API example makes sense! Inside my own code (we're using typescript here) I tend to prefer documenting public methods and not private methods (sometimes i even leave their signature out).