DEV Community

Discussion on: Commenting Code | Good Practices

Collapse
 
joelbonetr profile image
JoelBonetR 🥇

As senior dev/tech lead I would prefer to see, at least, @params and @return to avoid others loosing them time reading code that they'll forget in like 2 minutes.

The rule about not commenting the code is simply bullshit and needs a fallback which is "document your features and usecases" (which must be consultant's competence and not devs one) if you don't have one or another it will be harder to maintain the software even being 100% clean code.

Collapse
 
sargalias profile image
Spyros Argalias

Completely agree. I consider "comments as documentation" good. They make the project easier for developers to work with because glancing over the documentation is much faster and easier than reading through the code.

On the other hand, I think "Inline commenting" is bad. That's used when the code needs explaining because it's difficult to understand.

They're different things.

Thread Thread
 
joelbonetr profile image
JoelBonetR 🥇 • Edited

Sure! I'm talking just about the usual documentation above each function/method that defines the required information to work with this provided function/method without making you read the current implementation 😄